cnxoo commited on
Commit
6090fea
·
verified ·
1 Parent(s): c286fcf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -1
Dockerfile CHANGED
@@ -1,18 +1,28 @@
1
  FROM python:3.10-slim
 
2
  ENV PYTHONDONTWRITEBYTECODE=1 \
3
  PYTHONUNBUFFERED=1 \
4
  PIP_NO_CACHE_DIR=1 \
5
  TF_NUM_INTRAOP_THREADS=1 \
6
  TF_NUM_INTEROP_THREADS=1 \
7
  OMP_NUM_THREADS=1 \
8
- TF_CPP_MIN_LOG_LEVEL=2
 
 
 
 
9
 
10
  WORKDIR /app
 
 
 
 
11
  COPY requirements.txt /app/requirements.txt
12
  RUN python -m pip install --upgrade pip setuptools wheel && \
13
  pip install -r requirements.txt
14
 
15
  COPY main.py /app/main.py
16
  COPY Models /app/Models
 
17
  EXPOSE 7860
18
  CMD ["python","-m","uvicorn","main:app","--host","0.0.0.0","--port","7860","--workers","1"]
 
1
  FROM python:3.10-slim
2
+
3
  ENV PYTHONDONTWRITEBYTECODE=1 \
4
  PYTHONUNBUFFERED=1 \
5
  PIP_NO_CACHE_DIR=1 \
6
  TF_NUM_INTRAOP_THREADS=1 \
7
  TF_NUM_INTEROP_THREADS=1 \
8
  OMP_NUM_THREADS=1 \
9
+ TF_CPP_MIN_LOG_LEVEL=2 \
10
+ HOME=/app \
11
+ HF_HOME=/app/.cache \
12
+ HUGGINGFACE_HUB_CACHE=/app/.cache/huggingface \
13
+ TRANSFORMERS_CACHE=/app/.cache/huggingface
14
 
15
  WORKDIR /app
16
+
17
+
18
+ RUN mkdir -p /app/.cache/huggingface
19
+
20
  COPY requirements.txt /app/requirements.txt
21
  RUN python -m pip install --upgrade pip setuptools wheel && \
22
  pip install -r requirements.txt
23
 
24
  COPY main.py /app/main.py
25
  COPY Models /app/Models
26
+
27
  EXPOSE 7860
28
  CMD ["python","-m","uvicorn","main:app","--host","0.0.0.0","--port","7860","--workers","1"]