pengdaqian commited on
Commit
5938b1c
1 Parent(s): 4c170bb
Files changed (1) hide show
  1. Dockerfile +8 -1
Dockerfile CHANGED
@@ -1,5 +1,12 @@
1
  FROM python:3.8
2
 
 
 
 
 
 
 
 
3
  COPY requirements.txt requirements.txt
4
  RUN pip3 install --no-cache-dir -r requirements.txt
5
 
@@ -11,7 +18,7 @@ ENV HF_HOME $HOME/app/cache/transformers
11
 
12
  WORKDIR $HOME/app
13
 
14
- COPY . $HOME/app
15
 
16
  # cache model
17
  RUN python3 warm_up.py
 
1
  FROM python:3.8
2
 
3
+ RUN useradd -m -u 1000 user
4
+
5
+ USER user
6
+
7
+ ENV HOME=/home/user \
8
+ PATH=/home/user/.local/bin:$PATH
9
+
10
  COPY requirements.txt requirements.txt
11
  RUN pip3 install --no-cache-dir -r requirements.txt
12
 
 
18
 
19
  WORKDIR $HOME/app
20
 
21
+ COPY --chown=user . $HOME/app
22
 
23
  # cache model
24
  RUN python3 warm_up.py