ksvmuralidhar commited on
Commit
bd7da7f
·
verified ·
1 Parent(s): 91ad662

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -7
Dockerfile CHANGED
@@ -1,7 +1,20 @@
1
- FROM python:3.11-slim
2
- WORKDIR /webapp
3
- COPY . .
4
- RUN pip install --upgrade pip
5
- RUN pip install --no-cache-dir -r requirements.txt
6
- CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "app:app"]
7
- EXPOSE 7860
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # https://discuss.huggingface.co/t/permission-denied-for-writing-files-within-spaces/29799/2
2
+ # https://huggingface.co/docs/hub/spaces-sdks-docker#permissions
3
+
4
+ FROM python:3.10-slim
5
+ WORKDIR /code
6
+ COPY ./requirements.txt /code/requirements.txt
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+ RUN apt update && apt install -y ffmpeg
9
+
10
+ RUN useradd -m -u 1000 user
11
+ USER user
12
+ ENV HOME=/home/user \
13
+ PATH=/home/user/.local/bin:$PATH
14
+
15
+ WORKDIR $HOME/app
16
+
17
+ COPY --chown=user . $HOME/app
18
+
19
+ EXPOSE 7860
20
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "app:app"]