add MySql healthcheck to dependency for backend

Signed-off-by: Alvaro Carpio <alvanxp@outlook.com>
This commit is contained in:
Alvaro Carpio 2021-05-12 12:42:36 -05:00 committed by GitHub
parent 6cab41108c
commit 71daaa316d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,12 +4,18 @@ services:
build: backend build: backend
secrets: secrets:
- db-password - db-password
depends_on: depends_on:
- db db:
condition: service_healthy
db: db:
image: mysql:8.0.19 image: mysql:8.0.19
command: '--default-authentication-plugin=mysql_native_password' command: '--default-authentication-plugin=mysql_native_password'
restart: always restart: always
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
interval: 3s
retries: 5
start_period: 30s
secrets: secrets:
- db-password - db-password
volumes: volumes: