diff --git a/docker-compose.yaml b/docker-compose.yaml index 46e790e7..5f09d867 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,6 +7,11 @@ services: - MYSQL_DATABASE=touchh - MYSQL_USER=touchh - MYSQL_PASSWORD=${MYSQL_PASSWORD:-touchh} + healthcheck: + test: mariadb -utouchh -p${MYSQL_PASSWORD:-touchh} -e 'SELECT 1;' touchh + interval: 1s + timeout: 10s + retries: 10 volumes: - ./var/mysql:/var/lib/mysql bot: @@ -15,7 +20,9 @@ services: image: touchh-py restart: on-failure command: ['python3', 'manage.py', 'run_bot'] - depends_on: ['db'] + depends_on: + db: + condition: service_healthy stop_signal: SIGINT volumes: - .:/app