Skip to content

Instantly share code, notes, and snippets.

@silveimar
Created May 29, 2020 22:40
Show Gist options
  • Save silveimar/e34a20bdb0de8053b476ba2925caaa0a to your computer and use it in GitHub Desktop.
Save silveimar/e34a20bdb0de8053b476ba2925caaa0a to your computer and use it in GitHub Desktop.
Mysql Docker componse with healthcheck
version: '3.8'
services:
docker_db:
container_name: ${CONTAINER_NAME}
image: ${IMAGE_NAME}
environment:
- MYSQL_ROOT_PASSWORD=pwd
- MYSQL_USER=dockerdb
- MYSQL_PASSWORD=pwd
- MYSQL_ROOT_HOST=%
ports:
- 3310:3306
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 10s
interval: 10s
retries: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment