Ajout du Dockerfile

This commit is contained in:
2026-09-25 14:54:52 +02:00
parent 3e25f5847c
commit 7a49e73ed1
+18
View File
@@ -0,0 +1,18 @@
# Backend — image minimaliste (image minimale, non-root)
FROM python:3.12-slim
# Utilisateur non privilégié transforme une échappée en élévation directe sur l'hôte).
RUN useradd --create-home --uid 10001 appuser
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py store_file.py store_firestore.py config.py ./
# config.py est injecté au runtime (jamais dans l'image — module 07).
RUN mkdir -p /app/data && chown appuser:appuser /app /app/data
USER appuser
EXPOSE 5000
CMD ["python", "app.py"]