DATANESS commited on
Commit
4d1c149
·
verified ·
1 Parent(s): f28d0bf

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -0
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
6
+
7
+ WORKDIR /app
8
+
9
+ COPY --chown=user requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ RUN python -c "from transformers import pipeline; \
13
+ pipeline('sentiment-analysis', model='distilbert-base-uncased-finetuned-sst-2-english'); \
14
+ pipeline('sentiment-analysis', model='tabularisai/multilingual-sentiment-analysis')"
15
+
16
+ COPY --chown=user . .
17
+
18
+ EXPOSE 7860
19
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "120", "app:app"]