diff --git a/n8n/docker-compose-volume.yaml b/n8n/docker-compose-volume.yaml index 3003876..007ea4b 100644 --- a/n8n/docker-compose-volume.yaml +++ b/n8n/docker-compose-volume.yaml @@ -17,7 +17,18 @@ services: ports: - ${N8N_PORT:-5678}:5678 depends_on: - - db + db: + condition: service_healthy + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://localhost:5678/healthz || exit 1"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 30s + deploy: + resources: + limits: + memory: 512m restart: unless-stopped db: @@ -29,6 +40,16 @@ services: - POSTGRES_PASSWORD=${N8N_DB_PASSWORD:-changeme} volumes: - n8n-db:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U n8n -d n8n"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s + deploy: + resources: + limits: + memory: 512m restart: unless-stopped volumes: