ikechan8370 commited on
Commit
2408076
1 Parent(s): a9d067c

fix: permission

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -9
Dockerfile CHANGED
@@ -1,20 +1,29 @@
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 mkdir -p $HOME/app/.cache
 
 
11
  RUN chmod 777 $HOME/app/.cache
12
- COPY ./requirements.txt $HOME/app/requirements.txt
13
 
14
- RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y -y
 
15
 
16
- RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
 
17
 
18
  COPY --chown=user . $HOME/app
19
 
 
 
 
 
 
 
 
 
 
20
  CMD ["python", "$HOME/app/main.py"]
 
1
  FROM python:3.9
 
 
 
2
  ENV HOME=/home/user \
3
  PATH=/home/user/.local/bin:$PATH
4
+
5
+ RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
6
+
7
  RUN mkdir -p $HOME/app/.cache
8
+ RUN useradd -m -u 1000 user
9
+ RUN chown -R user $HOME/
10
  RUN chmod 777 $HOME/app/.cache
 
11
 
12
+ USER user
13
+ WORKDIR $HOME/app
14
 
15
+ ENV TRANSFORMERS_CACHE=$HOME/app/.cache \
16
+ HUGGINGFACE_HUB_CACHE=$HOME/app/.cache
17
 
18
  COPY --chown=user . $HOME/app
19
 
20
+
21
+
22
+
23
+
24
+
25
+ RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
26
+
27
+
28
+
29
  CMD ["python", "$HOME/app/main.py"]