fix: add health checks for backend and frontend services in docker-compose
Some checks failed
Build and Deploy Thoughts / build-and-deploy-local (push) Failing after 58s
Some checks failed
Build and Deploy Thoughts / build-and-deploy-local (push) Failing after 58s
This commit is contained in:
@@ -33,6 +33,11 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8000/health"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
|
||||||
@@ -42,6 +47,11 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-z", "localhost", "3000"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
environment:
|
environment:
|
||||||
- NEXT_PUBLIC_SERVER_SIDE_API_URL=http://proxy/api
|
- NEXT_PUBLIC_SERVER_SIDE_API_URL=http://proxy/api
|
||||||
networks:
|
networks:
|
||||||
@@ -52,8 +62,10 @@ services:
|
|||||||
image: custom-proxy:latest
|
image: custom-proxy:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- frontend
|
frontend:
|
||||||
- backend
|
condition: service_healthy
|
||||||
|
backend:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- traefik
|
- traefik
|
||||||
|
Reference in New Issue
Block a user