Files
zebra-power/docker-compose.yml

56 lines
1.2 KiB
YAML

# Docker Compose for Zebra Power - Production
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: zebra_backend
volumes:
- ./data:/app/data
environment:
- DATABASE_URL=sqlite:///data/zebra.db
- CORS_ORIGINS=http://localhost,http://127.0.0.1
restart: unless-stopped
# Required for WOL packets
network_mode: host
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: zebra_frontend
environment:
- VITE_API_URL=http://localhost:8000/api
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
container_name: zebra_nginx
ports:
- "80:80"
depends_on:
frontend:
condition: service_healthy
backend:
condition: service_healthy
restart: unless-stopped
volumes:
data: