Files
Holocore/docker-compose.yml
Ziggy deaf57cb4e Added healthcheck to the mongo container and the mongo-express container now depends on the mongo container being health before attempting to start
This way, we don't need "restart: always" to deal with the connection failures in mongo-express to mongo
2023-04-02 22:57:29 +02:00

37 lines
796 B
YAML

version: '3.8'
services:
mongo:
image: mongo:5.0.14
restart: "no"
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: cu
volumes:
- ./mongo_data:/data/db
- ./mongo_init_scripts:/docker-entrypoint-initdb.d
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/test --quiet
interval: 5s
timeout: 5s
retries: 5
start_period: 40s
mongo-express:
image: mongo-express:0.54.0
restart: "no"
depends_on:
mongo:
condition: service_healthy
ports:
- "8081:8081"
environment:
ME_CONFIG_MONGODB_URL: mongodb://mongo:27017/
healthcheck:
test: "wget -O - localhost:8081"
interval: 5s
timeout: 5s
retries: 5
start_period: 5s