FROM python:3.11-slim # Évite les logs bufferisés ENV PYTHONUNBUFFERED=1 WORKDIR /app # Dépendances système RUN apt-get update && apt-get install -y gcc && rm -rf /var/lib/apt/lists/* # Installer dépendances Python COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copier le projet COPY . . # Collecter les fichiers statiques RUN python manage.py collectstatic --noinput EXPOSE 8000 # Gunicorn : WSGI, 2 workers, port 8000 CMD ["gunicorn", "portfolio.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "2"]