From cbca1058a2c9627e1e58cd02e81d839d4c089174 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Tue, 9 Sep 2025 03:56:06 +0200 Subject: [PATCH] fix: add health checks for backend and frontend services in docker-compose --- compose.prod.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/compose.prod.yml b/compose.prod.yml index a3cd8ef..f43911d 100644 --- a/compose.prod.yml +++ b/compose.prod.yml @@ -33,6 +33,11 @@ services: depends_on: database: condition: service_healthy + healthcheck: + test: ["CMD", "wget", "-q", "--spider", "http://localhost:8000/health"] + interval: 10s + timeout: 5s + retries: 5 networks: - internal @@ -42,6 +47,11 @@ services: restart: unless-stopped depends_on: - backend + healthcheck: + test: ["CMD", "nc", "-z", "localhost", "3000"] + interval: 10s + timeout: 5s + retries: 5 environment: - NEXT_PUBLIC_SERVER_SIDE_API_URL=http://proxy/api networks: @@ -52,8 +62,10 @@ services: image: custom-proxy:latest restart: unless-stopped depends_on: - - frontend - - backend + frontend: + condition: service_healthy + backend: + condition: service_healthy networks: - internal - traefik