#version: "3.8" services: backend: build: context: . dockerfile: docker/backend/Dockerfile container_name: suivi_produit_backend restart: unless-stopped ports: - "${API_PORT:-8008}:8008" environment: - APP_ENV=${APP_ENV:-production} - LOG_LEVEL=${LOG_LEVEL:-INFO} - DATABASE_URL=sqlite:///backend/data/suivi.db volumes: # Persistance données SQLite + raw JSON (bind mount host) - ./backend/data:/app/backend/data # Persistance logs - backend_logs:/app/backend/logs # Config backend (optionnel, pour override) - ./backend/config_backend.json:/app/backend/config_backend.json:ro # Config frontend pour l'API (fallback docker) - ./frontend/public/config_frontend.json:/app/backend/config_frontend.json:ro healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8008/health"] interval: 30s timeout: 10s retries: 3 start_period: 10s networks: - suivi_network frontend: build: context: . dockerfile: docker/frontend/Dockerfile args: - VITE_API_URL=${VITE_API_URL:-http://backend:8008} container_name: suivi_produit_frontend restart: unless-stopped ports: - "${FRONTEND_PORT:-8080}:80" environment: - VITE_API_URL=${VITE_API_URL:-/api} depends_on: backend: condition: service_healthy healthcheck: test: ["CMD", "wget", "-q", "--spider", "http://localhost/health"] interval: 30s timeout: 5s retries: 3 networks: - suivi_network volumes: backend_data: name: suivi_produit_data backend_logs: name: suivi_produit_logs networks: suivi_network: name: suivi_produit_network driver: bridge