Ld75 commited on
Commit
186467b
·
1 Parent(s): 8ed958e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -4
Dockerfile CHANGED
@@ -3,13 +3,26 @@
3
 
4
  FROM python:3.9
5
 
6
- WORKDIR /code
7
 
8
- COPY ./requirements.txt /code/requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
12
- COPY . .
13
- ENV TRANSFORMERS_CACHE=/cache
 
 
14
 
15
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
3
 
4
  FROM python:3.9
5
 
 
6
 
7
+
8
+ # Set up a new user named "user" with user ID 1000
9
+ RUN useradd -m -u 1000 user
10
+ # Switch to the "user" user
11
+ USER user
12
+ # Set home to the user's home directory
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH
15
+
16
+ # Set the working directory to the user's home directory comme ça il aura les droits d'ecriture
17
+ WORKDIR $HOME/app
18
+
19
+
20
 
21
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
22
 
23
+ COPY --chown=user . $HOME/app
24
+ COPY ./requirements.txt $HOME/app/code/requirements.txt
25
+ #COPY . .
26
+ ENV TRANSFORMERS_CACHE=/home/user/cache
27
 
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]