| | 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 |
| |
|
| | |
| | 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"] |