shima-n commited on
Commit
a714460
·
verified ·
1 Parent(s): ae3d41c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -2
Dockerfile CHANGED
@@ -1,11 +1,29 @@
1
  FROM python:3.10-slim
 
 
2
  RUN apt-get update && apt-get install -y \
3
  git git-lfs ffmpeg libsm6 libxext6 libgl1 && \
4
  rm -rf /var/lib/apt/lists/*
 
 
5
  WORKDIR /app
6
  COPY requirements.txt .
7
  RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
8
  COPY . .
9
- ENV GRADIO_SERVER_NAME=0.0.0.0
10
- ENV PORT=7860
 
 
 
11
  CMD ["python","app.py"]
 
1
  FROM python:3.10-slim
2
+
3
+ # system deps
4
  RUN apt-get update && apt-get install -y \
5
  git git-lfs ffmpeg libsm6 libxext6 libgl1 && \
6
  rm -rf /var/lib/apt/lists/*
7
+
8
+ # app dir
9
  WORKDIR /app
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # set writable caches
14
+ ENV HF_HOME=/app/.cache \
15
+ HF_HUB_CACHE=/app/.cache/hub \
16
+ HF_DATASETS_CACHE=/app/.cache/datasets \
17
+ TRANSFORMERS_CACHE=/app/.cache/transformers
18
+
19
+ # ensure dirs exist and are writable
20
+ RUN mkdir -p /app/.cache/hub /app/.cache/datasets /app/.cache/transformers
21
+
22
+ # app code
23
  COPY . .
24
+
25
+ # gradio runs on PORT
26
+ ENV GRADIO_SERVER_NAME=0.0.0.0 \
27
+ PORT=7860
28
+
29
  CMD ["python","app.py"]