Spaces:
Sleeping
Sleeping
ikechan8370
commited on
Commit
•
2293487
1
Parent(s):
ed29561
fix: permission
Browse files- Dockerfile +12 -10
Dockerfile
CHANGED
@@ -1,17 +1,19 @@
|
|
1 |
FROM python:3.9
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
COPY ./requirements.txt /
|
10 |
|
11 |
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y -y
|
12 |
|
13 |
-
RUN pip install --no-cache-dir --upgrade -r /
|
14 |
|
15 |
-
COPY . /
|
16 |
|
17 |
-
CMD ["python", "/
|
|
|
1 |
FROM python:3.9
|
2 |
+
RUN useradd -m -u 1000 user
|
3 |
+
USER user
|
4 |
|
5 |
+
ENV HOME=/home/user \
|
6 |
+
PATH=/home/user/.local/bin:$PATH
|
7 |
+
WORKDIR $HOME/app
|
8 |
+
ENV TRANSFORMERS_CACHE=$HOME/app/.cache
|
9 |
+
ENV HUGGINGFACE_HUB_CACHE=$HOME/app/.cache
|
10 |
+
RUN chmod 777 $HOME/app/.cache
|
11 |
+
COPY ./requirements.txt $HOME/app/requirements.txt
|
12 |
|
13 |
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y -y
|
14 |
|
15 |
+
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
|
16 |
|
17 |
+
COPY --chown=user . $HOME/app
|
18 |
|
19 |
+
CMD ["python", "$HOME/app/main.py"]
|