Skip to content

Commit

Permalink
use new couchdb image, refactor compose file, add debug to bootstrap.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones-plip committed Feb 10, 2025
1 parent c7b8a2d commit 13abac5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
36 changes: 15 additions & 21 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
version: '3.7'
services:
couch:
image: couchdb:2.3.1
image: public.ecr.aws/medic/cht-couchdb:4.17.0
environment:
COUCHDB_USER: cht
COUCHDB_PASSWORD: cht-password
networks:
- cht-net
- "COUCHDB_USER=cht"
- "COUCHDB_PASSWORD=cht-password"
- "COUCHDB_SECRET=424a71c9-bb2b-44ba-9ea2-2ae97e78f41d"
- "COUCHDB_UUID=424a71c9-bb2b-44ba-9ea2-2ae97e78f41d"
- "SVC_NAME=couch"
- "COUCHDB_LOG_LEVEL=debug"
ports:
- 5984:5984

postgres:
image: medicmobile/cht-postgres:release-postgres13-rc.1
environment:
POSTGRES_DB: cht
POSTGRES_USER: cht
POSTGRES_PASSWORD: cht_password
COUCH2PG_USER: cht_couch2pg
COUCH2PG_USER_PASSWORD: couch2pg_password
DB_OWNER_GROUP: cht_analytics
- "POSTGRES_DB=cht"
- "POSTGRES_USER=cht"
- "POSTGRES_PASSWORD=cht_password"
- "COUCH2PG_USER=cht_couch2pg"
- "COUCH2PG_USER_PASSWORD=couch2pg_password"
- "DB_OWNER_GROUP=cht_analytics"
volumes:
- cht-postgres-data:/var/lib/postgresql/data
networks:
- cht-net
ports:
- ${PG_PORT:-5432}:5432

Expand All @@ -39,17 +40,10 @@ services:
POSTGRES_PASSWORD: cht_password
POSTGRES_SERVER_NAME: ${POSTGRES_SERVER_NAME:-postgres}
POSTGRES_DB_NAME: cht

networks:
- cht-net
depends_on:
- postgres
- couch

networks:
cht-net:
name: cht-net

volumes:
cht-postgres-data:
name: cht-postgres-data
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:

postgres:
Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const waitForPg = async (dbUrl) => {
return true;
} catch(err) {
if(err.code !== 'ECONNREFUSED') {
console.log(err);
console.log('Failed to connect to postgres server', dbUrl, err);
process.exit(1);
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@ before(async () => {
if (!process.env.TEST_PG_URL) {
throw new Error('TEST_PG_URL is undefined.');
}

console.log('Node Version',process.version);
await waitForCouch(process.env.TEST_COUCH_URL);
await waitForPg(process.env.TEST_PG_URL);
});

0 comments on commit 13abac5

Please sign in to comment.