diff --git a/nextcloud/compose.yml b/nextcloud/compose.yml index 92555c0..1100713 100644 --- a/nextcloud/compose.yml +++ b/nextcloud/compose.yml @@ -6,14 +6,21 @@ services: container_name: nextcloud restart: always depends_on: - - nextcloud_db - - nextcloud_redis + nextcloud_db: + condition: service_healthy + nextcloud_redis: + condition: service_healthy environment: - POSTGRES_HOST=nextcloud_db - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=${DB_PASSWORD} - REDIS_HOST=nextcloud_redis + healthcheck: + test: curl -f http://localhost/status.php || exit 1 + interval: 30s + timeout: 10s + retries: 3 networks: - default - traefik @@ -29,6 +36,11 @@ services: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=${DB_PASSWORD} + healthcheck: + test: pg_isready + interval: 30s + timeout: 10s + retries: 3 networks: - default volumes: @@ -38,6 +50,11 @@ services: image: redis:8 container_name: nextcloud_redis restart: always + healthcheck: + test: redis-cli ping + interval: 30s + timeout: 10s + retries: 3 networks: - default volumes: