Files
MH-DashBoard-organization/docker-compose.yml
2026-03-25 10:43:39 +09:00

73 lines
1.7 KiB
YAML
Executable File

services:
proxy:
image: nginx:1.27-alpine
depends_on:
frontend:
condition: service_healthy
backend:
condition: service_healthy
ports:
- "8080:80"
volumes:
- ./proxy/nginx.conf:/etc/nginx/conf.d/default.conf:ro
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1/ || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1/ || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
backend:
build:
context: .
dockerfile: backend/Dockerfile
env_file:
- .env
depends_on:
db:
condition: service_healthy
volumes:
- uploads_data:/data/uploads
- snapshots_data:/data/snapshots
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health')\" || exit 1"]
interval: 15s
timeout: 5s
retries: 8
start_period: 20s
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
volumes:
postgres_data:
uploads_data:
snapshots_data: