diff --git a/compose.yaml b/compose.yaml index 43b68f4..b78a7e5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -10,12 +10,19 @@ services: - TZ=${timezone} - PIWIGO_UID=${PIWIGO_UID} - PIWIGO_GID=${PIWIGO_GID} + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:80/index.php || exit 1"] + start_period: 30s + interval: 10s + timeout: 5s + retries: 3 networks: - piwigo-network ports: - ${piwigo_port}:80 depends_on: - - piwigo-db + piwigo-db: + condition: service_healthy volumes: - ./piwigo-data/piwigo:/var/www/html/piwigo/ - ./piwigo-data/scripts:/usr/local/bin/scripts/ @@ -29,6 +36,12 @@ services: # Defined in .env - MARIADB_PASSWORD=${db_user_password} - TZ=${timezone} + healthcheck: + test: ["CMD-SHELL", "healthcheck.sh --connect --innodb_initialized"] + start_period: 10s + interval: 10s + timeout: 5s + retries: 3 networks: - piwigo-network volumes: