Skip to content

Instantly share code, notes, and snippets.

@sjpuas
Created January 12, 2017 23:48
Show Gist options
  • Save sjpuas/0fdfc6b23521bf0111fe19ab3d58b527 to your computer and use it in GitHub Desktop.
Save sjpuas/0fdfc6b23521bf0111fe19ab3d58b527 to your computer and use it in GitHub Desktop.
docker-compose v2.1 healthcheck and service_healthy
version: '2.1'
services:
web:
image: nginx:alpine
depends_on:
db:
condition: service_healthy
db:
image: redis:alpine
healthcheck:
test: ["CMD", "redis-cli","ping"]
interval: 30s
timeout: 10s
retries: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment