ayf3 commited on
Commit
f22431f
·
verified ·
1 Parent(s): 71ee5ef

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -5
Dockerfile CHANGED
@@ -1,14 +1,27 @@
1
  FROM python:3.10-slim
2
 
3
- RUN apt-get update && apt-get install -y git ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- WORKDIR /app
6
  COPY requirements.txt .
7
- RUN pip install --no-cache-dir -r requirements.txt
 
8
 
9
  COPY app.py .
10
 
11
- ENV GRADIO_SERVER_NAME="0.0.0.0"
12
- EXPOSE 7860
13
 
14
  CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ ffmpeg \
5
+ libsndfile1 \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ RUN useradd -m -u 1000 user
9
+
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH \
12
+ PYTHONUNBUFFERED=1 \
13
+ PYTHONIOENCODING=UTF-8 \
14
+ HF_HOME=/home/user/.cache/huggingface \
15
+ PORT=7860
16
+
17
+ WORKDIR /home/user/app
18
 
 
19
  COPY requirements.txt .
20
+ RUN pip install --no-cache-dir --upgrade pip && \
21
+ pip install --no-cache-dir -r requirements.txt
22
 
23
  COPY app.py .
24
 
25
+ USER user
 
26
 
27
  CMD ["python", "app.py"]