davanstrien HF staff commited on
Commit
9ec1a39
1 Parent(s): 41423f0

Add user and set up environment variables

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -0
Dockerfile CHANGED
@@ -1,5 +1,16 @@
1
  FROM python:3.11
 
 
2
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /code
4
 
5
  COPY ./requirements.txt /code/requirements.txt
 
1
  FROM python:3.11
2
+ # Set up a new user named "user" with user ID 1000
3
+ RUN useradd -m -u 1000 user
4
 
5
+ # Switch to the "user" user
6
+ USER user
7
+
8
+ # Set home to the user's home directory
9
+ ENV HOME=/home/user \
10
+ PATH=/home/user/.local/bin:$PATH
11
+
12
+ # Set the working directory to the user's home directory
13
+ WORKDIR $HOME/code
14
  WORKDIR /code
15
 
16
  COPY ./requirements.txt /code/requirements.txt