feat: ajout Docker Compose et documentation outils
- Dockerfile backend (Python 3.11 + Poetry + Playwright/Chromium) - Dockerfile frontend (Node 20 + Vite build + Nginx) - docker-compose.yml avec services et volumes persistants - Proxy Nginx pour API (/api -> backend:8008) - Healthchecks sur les deux services - Configuration Docker (.env.docker, .dockerignore) - Documentation déploiement Docker dans README - Fichier docs/tools_used.md avec liste des technologies Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
66
docker-compose.yml
Normal file
66
docker-compose.yml
Normal file
@@ -0,0 +1,66 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user