File size: 646 Bytes
4d1c149 f1b4330 4d1c149 f1b4330 4d1c149 f1b4330 4d1c149 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | FROM python:3.10-slim
RUN useradd -m -u 1000 user
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Télécharger les modèles pendant le build
RUN python -c "from transformers import pipeline; \
m1 = pipeline('sentiment-analysis', model='distilbert-base-uncased-finetuned-sst-2-english'); \
m2 = pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis'); \
print('Models downloaded!')"
USER user
ENV PATH="/home/user/.local/bin:$PATH"
COPY --chown=user . .
EXPOSE 7860
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "120", "app:app"] |