Docker : support env vars, compose standard + swarm séparés
- Dockerfile : copie config.json dans l'image (évite le problème de répertoire) - app.py : load_config() lit les variables d'environnement en priorité sur config.json - docker-compose.yml : converti en compose standard (sans section deploy Swarm) - docker-compose.swarm.yml : nouveau fichier dédié au déploiement Docker Swarm Variables supportées : OLLAMA_URL, OLLAMA_CLUSTER_MODEL, OLLAMA_LOCAL_MODEL, SITE_CALENDAR_URL, SITE_BASE_URL, AUTH_SESSION_SECRET, AUTH_USERS Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
# Déploiement Docker Swarm
|
||||
# 1. Construire l'image : docker build -t git.piaf.im/sylvain/planning2ics:latest ./webapp
|
||||
# 2. Déployer : docker stack deploy -c webapp/docker-compose.swarm.yml planning2ics
|
||||
|
||||
services:
|
||||
app:
|
||||
image: git.piaf.im/sylvain/planning2ics:latest
|
||||
ports:
|
||||
- "8080:8000"
|
||||
volumes:
|
||||
- planning_data:/app/data
|
||||
# Optionnel : surcharger la config avec un fichier local
|
||||
# - ./config.json:/app/config.json:ro
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
# Variables de configuration (priorité sur config.json embarqué)
|
||||
# - OLLAMA_URL=http://192.168.7.119:11434
|
||||
# - OLLAMA_CLUSTER_MODEL=qwen3.5:cloud
|
||||
# - OLLAMA_LOCAL_MODEL=qwen3:8b
|
||||
# - SITE_CALENDAR_URL=https://www.opera-orchestre-montpellier.fr/calendrier/?saisons=32669
|
||||
# - SITE_BASE_URL=https://www.opera-orchestre-montpellier.fr
|
||||
# - AUTH_SESSION_SECRET=changez-cette-cle-secrete-en-production
|
||||
# - AUTH_USERS=[{"username":"admin","password":"changeme"}]
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 10s
|
||||
failure_action: rollback
|
||||
resources:
|
||||
limits:
|
||||
memory: 512M
|
||||
|
||||
volumes:
|
||||
planning_data:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user