Skip to content

Commit

Permalink
dev env endpoint couchdb update
Browse files Browse the repository at this point in the history
  • Loading branch information
rabellino-noaa committed Jul 15, 2024
1 parent 5c0b478 commit be0425f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 25 deletions.
12 changes: 10 additions & 2 deletions couchdb/uat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM couchdb:latest

ENV COUCHDB_USER=admin
ENV COUCHDB_PASSWORD=admin

EXPOSE 5984
COPY uat.sh uat.sh
RUN sh uat.sh

COPY startup.sh /usr/local/bin/startup.sh

RUN chmod +x /usr/local/bin/startup.sh

ENTRYPOINT [ "/usr/local/bin/startup.sh" ]
48 changes: 48 additions & 0 deletions couchdb/uat/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh

# create some basic configurations
cat >/opt/couchdb/etc/local.ini <<EOF
[couchdb]
single_node=true
[admins]
admin = admin
EOF

#nohup bash -c "/docker-entrypoint.sh /opt/couchdb/bin/couchdb &"
#sleep 5

# Start CouchDB in the background
/opt/couchdb/bin/couchdb &

# Wait for CouchDB to start
until curl -s http://127.0.0.1:5984/_up; do
echo "Waiting for CouchDB to start..."
sleep 1
done

# Curl the _users table
echo "Curling the _users table..."
curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD http://127.0.0.1:5984/_users

# Curl the _replicator table
echo "Curling the _replicator table..."
curl -s -u $COUCHDB_USER:$COUCHDB_PASSWORD http://127.0.0.1:5984/_replicator

# Bring CouchDB to the foreground
wait



#!/bin/sh -xe



#curl -X PUT http://admin:[email protected]:5984/_users
#curl -X PUT http://admin:[email protected]:5984/_replicator
#curl -X PUT http://admin:[email protected]:5984/idss

# Bring CouchDB to the foreground
#wait

# this is handled by the loader python script instead
23 changes: 0 additions & 23 deletions couchdb/uat/uat.sh

This file was deleted.

0 comments on commit be0425f

Please sign in to comment.