diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..729428b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# backend/Dockerfile +FROM python:3.11-slim + +RUN addgroup --system app && adduser --system --ingroup app app + +WORKDIR /srv/app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +# Assurer permissions +RUN chown -R app:app /srv/app + +USER app + +# Port interne +EXPOSE 5000 + +# Variable d'environnement par défaut +ENV FLASK_ENV=production +ENV GUNICORN_WORKERS=3 +ENV GUNICORN_THREADS=2 + +# Commande de démarrage via gunicorn (attache l'app Flask : app:app) +# Utilise timeout raisonnable, bind sur 0.0.0.0:5000 +CMD ["sh", "-c", "gunicorn --workers ${GUNICORN_WORKERS} --threads ${GUNICORN_THREADS} --bind 0.0.0.0:5000 --access-logfile - --error-logfile - 'main:app'"] diff --git a/requirements.txt b/requirements.txt index f0bb836..c4b02c4 100644 Binary files a/requirements.txt and b/requirements.txt differ