Rapatrie la #118 (DAGs Airflow). Quatre conflits, tous additifs sauf un : - `.env.example` et `.gitignore` : les blocs Airflow et proxy cohabitent. - `Makefile` : `AIRFLOW` rejoint les variables de dossier, les cibles Airflow et TLS cohabitent dans `.PHONY`. - `00-vue-ensemble.md` : la ligne ML de `dev` est retenue, la ligne Infra de cette branche aussi, chacune portant sa propre mise à jour. L'interface Airflow rejoint la base et Mailpit sur `127.0.0.1` dans l'overlay : elle n'a pas d'authentification à publier derrière le proxy.
71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
# Piège : `APP_ENV` et `APP_DEBUG` sont en dur et non en `${APP_ENV:-prod}` : le `.env` du poste
|
|
# vaut `local` et reprendrait le dessus, ce qui laisserait le cookie sans `__Secure-` et
|
|
# rouvrirait `/docs`. Hors `local`, l'API exige en retour une origine CORS non vide.
|
|
# Piège : les listes de ports se cumulent à la fusion des deux fichiers. `!reset` est le seul
|
|
# moyen de dépublier 8000 et 3000 : sans lui, l'API resterait joignable en clair à côté du proxy.
|
|
|
|
name: enervision
|
|
|
|
services:
|
|
db:
|
|
ports: !override
|
|
- "127.0.0.1:${POSTGRES_PORT:-5433}:5432"
|
|
|
|
mailpit:
|
|
ports: !override
|
|
- "127.0.0.1:${MAILPIT_UI_PORT:-8025}:8025"
|
|
|
|
airflow-webserver:
|
|
ports: !override
|
|
- "127.0.0.1:${AIRFLOW_PORT:-8080}:8080"
|
|
|
|
backend:
|
|
ports: !reset null
|
|
command:
|
|
- uvicorn
|
|
- app.main:create_app
|
|
- --factory
|
|
- --host
|
|
- 0.0.0.0
|
|
- --port
|
|
- "8000"
|
|
- --proxy-headers
|
|
- --forwarded-allow-ips=*
|
|
environment:
|
|
APP_ENV: prod
|
|
APP_DEBUG: "false"
|
|
APP_TRUST_PROXY_HEADERS: "true"
|
|
APP_CORS_ORIGINS: https://${PUBLIC_HOST:?PUBLIC_HOST est requis pour la stack complète}
|
|
APP_FRONTEND_RESET_PASSWORD_URL: https://${PUBLIC_HOST}/reset-password
|
|
|
|
frontend:
|
|
ports: !reset null
|
|
|
|
proxy:
|
|
image: nginx:1.28-alpine
|
|
depends_on:
|
|
- backend
|
|
- frontend
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./infra/proxy/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./infra/proxy/conf.d:/etc/nginx/conf.d:ro
|
|
- ./infra/proxy/tls:/etc/nginx/tls:ro
|
|
- acme_webroot:/var/www/certbot
|
|
restart: unless-stopped
|
|
|
|
certbot:
|
|
image: certbot/certbot
|
|
profiles: ["acme"]
|
|
volumes:
|
|
- letsencrypt:/etc/letsencrypt
|
|
- acme_webroot:/var/www/certbot
|
|
- ./infra/proxy/tls:/tls
|
|
- ./infra/proxy/acme-deploy-hook.sh:/deploy-hook.sh:ro
|
|
|
|
volumes:
|
|
acme_webroot:
|
|
letsencrypt:
|