Added healthcheck into docker-compose.yml

This commit is contained in:
Mario
2022-05-19 23:17:29 +02:00
parent 8f75a40842
commit f9ad884739

View File

@ -5,6 +5,9 @@ services:
build: . build: .
#network_mode: host #Not work on Mac OS #network_mode: host #Not work on Mac OS
container_name: beelzebub container_name: beelzebub
depends_on:
mongo:
condition: service_healthy
ports: # Remove me, if use configuration network_mode: host ports: # Remove me, if use configuration network_mode: host
- "22:22" - "22:22"
- "8080:8080" - "8080:8080"
@ -14,6 +17,11 @@ services:
image: mongo image: mongo
container_name: mongo container_name: mongo
restart: always restart: always
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/test --quiet
interval: 30s
timeout: 10s
retries: 5
environment: environment:
MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example MONGO_INITDB_ROOT_PASSWORD: example