Created
August 21, 2018 19:11
-
-
Save HorlogeSkynet/26d2664c265fc0dc54f907e456962148 to your computer and use it in GitHub Desktop.
How to start application container only once MongoDB has finished warming up, running with Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.3' | |
services: | |
application: | |
build: . | |
depends_on: | |
database: | |
condition: service_healthy | |
database: | |
image: mongo:latest | |
restart: unless-stopped | |
healthcheck: | |
test: mongo --quiet --eval "db.runCommand('ping').ok" | |
interval: 30s | |
timeout: 5s | |
retries: 3 | |
start_period: 15s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment