feat: healthchecks for postgres, redis, minio;
feat: backend container now depends on postgres, redis and minio (must be healthy); feat: frontend depends on backend being healthy
This commit is contained in:
@@ -3,9 +3,16 @@ services:
|
||||
backend:
|
||||
build: ./backend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
minio:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "/usr/bin/curl", "-f", "http://localhost:8080/service/health"]
|
||||
interval: 30s
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
ports:
|
||||
@@ -16,11 +23,19 @@ services:
|
||||
frontend:
|
||||
build: ./frontend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- easywish-network
|
||||
|
||||
minio:
|
||||
image: minio/minio
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-I", "localhost:9000/minio/health/live" ]
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
||||
@@ -34,6 +49,11 @@ services:
|
||||
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
healthcheck:
|
||||
test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
@@ -48,6 +68,11 @@ services:
|
||||
|
||||
redis:
|
||||
image: eqalpha/keydb
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
command: ["keydb-server", "--requirepass", "${REDIS_PASSWORD}"]
|
||||
environment:
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
|
||||
Reference in New Issue
Block a user