voting-app/docker/docker-compose.yml
2026-05-15 15:16:18 -05:00

39 lines
1012 B
YAML

services:
backend:
build:
context: ..
dockerfile: docker/Dockerfile.backend
container_name: voting-app-backend
ports:
- "8001:8000"
env_file:
- ../.env
volumes:
- ../data:/app/data
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
command: ["python", "-m", "src.main", "--port", "8000"]
frontend:
build:
context: ..
dockerfile: docker/Dockerfile.frontend
args:
VITE_API_URL: http://localhost:8001
VITE_APP_TITLE: ${VITE_APP_TITLE:-Voting App}
container_name: voting-app-frontend
ports:
- "5174:5173"
env_file:
- ../.env
volumes:
- ../frontend:/app/frontend
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
command: ["npx", "vite", "preview", "--host", "0.0.0.0", "--port", "5173"]