20 lines
392 B
Docker
20 lines
392 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Installation des dépendances (versions fixées dans requirements.txt)
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copie du code applicatif
|
|
COPY run.py .
|
|
COPY app ./app
|
|
|
|
# Utilisateur non-root pour l'exécution
|
|
RUN useradd -m appuser && chown -R appuser:appuser /app
|
|
USER appuser
|
|
|
|
EXPOSE 5000
|
|
|
|
CMD ["python", "run.py"]
|