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:
40
docker/frontend/Dockerfile
Normal file
40
docker/frontend/Dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
# Dockerfile Frontend - Build Vite + Nginx
|
||||
# Stage 1: Build
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copier les fichiers de dépendances
|
||||
COPY frontend/package*.json ./
|
||||
|
||||
# Installer les dépendances
|
||||
RUN npm ci
|
||||
|
||||
# Copier le code source
|
||||
COPY frontend/ ./
|
||||
|
||||
# Argument pour l'URL de l'API (défaut: docker network)
|
||||
ARG VITE_API_URL=http://backend:8008
|
||||
|
||||
# Build de production
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Nginx
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copier la config Nginx personnalisée
|
||||
COPY docker/frontend/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copier les fichiers buildés
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Copier le script d'entrypoint pour injecter les variables d'environnement
|
||||
COPY docker/frontend/entrypoint.sh /docker-entrypoint.d/40-env-config.sh
|
||||
RUN chmod +x /docker-entrypoint.d/40-env-config.sh
|
||||
|
||||
# Exposer le port
|
||||
EXPOSE 80
|
||||
|
||||
# Healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||
CMD wget -q --spider http://localhost/ || exit 1
|
||||
Reference in New Issue
Block a user