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}
|
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- db_data:/var/lib/mysql
|
- db_data:/var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
wordpress:
|
wordpress:
|
||||||
container_name: gustavoo-me
|
container_name: gustavoo-me
|
||||||
@@ -24,7 +30,8 @@ services:
|
|||||||
- ./wp-content/themes:/var/www/html/wp-content/themes
|
- ./wp-content/themes:/var/www/html/wp-content/themes
|
||||||
- ./wp-content/plugins:/var/www/html/wp-content/plugins
|
- ./wp-content/plugins:/var/www/html/wp-content/plugins
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db_data:
|
db_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user