AkshayaKeerthi commited on
Commit
f1bd605
·
verified ·
1 Parent(s): 5a18b7c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -5
Dockerfile CHANGED
@@ -1,13 +1,22 @@
1
- FROM python:3.9
2
 
3
  RUN useradd -m -u 1000 user
4
 
5
  WORKDIR /app
6
 
7
- COPY --chown=user ./requirements.txt requirements.txt
8
-
9
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
10
 
11
- COPY --chown=user . /app
 
 
 
 
 
 
 
 
 
 
12
 
13
- CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]
 
1
+ FROM python:3.9-slim
2
 
3
  RUN useradd -m -u 1000 user
4
 
5
  WORKDIR /app
6
 
7
+ COPY requirements.txt requirements.txt
 
8
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
9
 
10
+ # Set the cache directory and pre-download the model
11
+ RUN mkdir -p /app/.cache/huggingface
12
+ ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
13
+
14
+ COPY . .
15
+
16
+ RUN chown -R user:user /app
17
+
18
+ USER user
19
+
20
+ EXPOSE 5000
21
 
22
+ CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]