Skip to content

Commit

Permalink
ci(docker-compose): add network
Browse files Browse the repository at this point in the history
  • Loading branch information
lulu12329 committed Feb 16, 2024
1 parent 0e72a0b commit 33340da
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
ports:
- 3000:3000
restart: unless-stopped
networks:
- mongo

mongo:
image: mongo:6.0.3
Expand All @@ -24,18 +26,24 @@ services:
command:
- --config
- /etc/mongo/mongo.conf
ports:
- 27017:27017
expose:
- 27017
healthcheck:
test:
[
'CMD',
'sh',
'-c',
'echo ''db.runCommand("ping").ok'' | mongosh localhost:27017 --quiet',
'echo ''db.runCommand("ping").ok'' | mongosh localhost:27017 --quiet'
]
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
restart: unless-stopped
networks:
- mongo

networks:
mongo:
name: mongo

0 comments on commit 33340da

Please sign in to comment.