simplify compose: add healthcheck and depends_on condition
This commit is contained in:
+8
-1
@@ -8,6 +8,12 @@ services:
|
||||
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
|
||||
wordpress:
|
||||
container_name: gustavoo-me
|
||||
@@ -24,7 +30,8 @@ services:
|
||||
- ./wp-content/themes:/var/www/html/wp-content/themes
|
||||
- ./wp-content/plugins:/var/www/html/wp-content/plugins
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
|
||||
Reference in New Issue
Block a user