Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

docs(docker): add healthcheck for docker compose

LinkinStars8d757c6c589f
diff --git a/docker-compose.uffizzi.yml b/docker-compose.uffizzi.yml
index a6df6e80..3d266286 100644
--- a/docker-compose.uffizzi.yml
+++ b/docker-compose.uffizzi.yml
@@ -1,4 +1,4 @@
-version: "3"
+version: "3.9"
# uffizzi integration
x-uffizzi:
@@ -26,6 +26,11 @@ services:
volumes:
- answer-data:/data
+ depends_on:
+ mysql:
+ condition: service_healthy
+ links:
+ - db
deploy:
resources:
limits:
@@ -38,6 +43,11 @@ services:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_USER=mysql
- MYSQL_PASSWORD=mysql
+ healthcheck:
+ test: [ "CMD", "mysqladmin" ,"ping", "-uroot", "-ppassword" ]
+ timeout: 20s
+ retries: 10
+ command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci', '--skip-character-set-client-handshake']
volumes:
- sql_data:/var/lib/mysql
deploy: