Skip to content

Commit

Permalink
fix docker compose mongo db to use 27019 instead of default port
Browse files Browse the repository at this point in the history
  • Loading branch information
hossenlopp committed Feb 11, 2025
1 parent 53cc488 commit b040f7b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ services:
- "linux/arm64"
image: tacoma/measure-repository-service
environment:
DATABASE_URL: 'mongodb://mongo:27017/measure-repository?replicaSet=rs0'
DATABASE_URL: 'mongodb://mongo:27019/measure-repository?replicaSet=rs0'
AUTHORING: true
ports:
- "3000:3000"
stdin_open: true
Expand All @@ -30,26 +31,24 @@ services:
environment:
PUBLIC_MRS_SERVER: http://localhost:3000/4_0_1
MRS_SERVER: http://measure-service:3000/4_0_1
MONGODB_URI: mongodb://mongo:27017/draft-repository?replicaSet=rs0
MONGODB_URI: mongodb://mongo:27019/draft-repository?replicaSet=rs0
ports:
- '3001:3001'
stdin_open: true
tty: true

mongo:
image: mongo:7.0
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"]
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27019"]
expose:
- "27017:27017"
ports:
- 27017:27017
- "27019:27019"
# uncomment the following to have access to the containerized mongo at 27018
# ports:
# - "27018:27017"
ports:
- "27019:27019"
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'host.docker.internal:27017'}]}) }" | mongosh --port 27017 --quiet
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo:27019'}]}) }" | mongosh --port 27019 --quiet
interval: 5s
timeout: 30s
start_period: 0s
Expand Down

0 comments on commit b040f7b

Please sign in to comment.