fix prod : Eau2018.xls hors du volume /app + pin Trivy
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Le volume backend-data monté sur /app masquait Eau2018.xls copié dans l'image à /app/Eau2018.xls — d'où le FileNotFoundError au step seed CI. - Dockerfile : copie Eau2018.xls dans /opt/ (hors mount) - seed.py : résolution multi-chemin avec /opt en priorité (Docker) - .woodpecker.yml : trivy:latest -> trivy:0.70.0 (pin reproductibilité) Note : si le seed replante avec la même erreur après ce commit, c'est que le volume backend-data en prod a aussi un seed.py figé (shadowing de /app entier). Fix de fond à venir : déplacer le mount sur /app/data.
This commit is contained in:
@@ -17,9 +17,12 @@ from app.services.auth_service import hash_password
|
||||
from app.services.import_service import generate_auth_code
|
||||
from app.engine.pricing import HouseholdData, compute_p0
|
||||
|
||||
XLS_PATH = os.path.join(os.path.dirname(__file__), "Eau2018.xls")
|
||||
if not os.path.exists(XLS_PATH):
|
||||
XLS_PATH = os.path.join(os.path.dirname(__file__), "..", "Eau2018.xls")
|
||||
_XLS_CANDIDATES = [
|
||||
"/opt/Eau2018.xls", # image Docker (hors volume monté sur /app)
|
||||
os.path.join(os.path.dirname(__file__), "Eau2018.xls"),
|
||||
os.path.join(os.path.dirname(__file__), "..", "Eau2018.xls"), # dev local depuis backend/
|
||||
]
|
||||
XLS_PATH = next((p for p in _XLS_CANDIDATES if os.path.exists(p)), _XLS_CANDIDATES[-1])
|
||||
|
||||
|
||||
# Codes fixes — identiques dans le dev hint frontend
|
||||
|
||||
Reference in New Issue
Block a user