carlosgomes98 commited on
Commit
bb3b7cd
1 Parent(s): e55a884

fix dockerfile user

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -0
Dockerfile CHANGED
@@ -14,8 +14,14 @@ RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
14
 
15
  WORKDIR /code
16
 
 
 
 
 
17
  # Set home to the user's home directory
18
  ENV HOME=/home/user \
 
 
19
  PYTHONUNBUFFERED=1 \
20
  GRADIO_ALLOW_FLAGGING=never \
21
  GRADIO_NUM_PORTS=1 \
@@ -50,6 +56,7 @@ WORKDIR $HOME/app
50
  # ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/miniconda/lib"
51
 
52
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
 
53
  COPY --chown=user . $HOME/app
54
 
55
  CMD ["python3", "app.py"]
 
14
 
15
  WORKDIR /code
16
 
17
+ RUN useradd -m -u 1000 user
18
+
19
+ # Switch to the "user" user
20
+ USER user
21
  # Set home to the user's home directory
22
  ENV HOME=/home/user \
23
+ PATH=/home/user/.local/bin:$PATH \
24
+ PYTHONPATH=$HOME/app \
25
  PYTHONUNBUFFERED=1 \
26
  GRADIO_ALLOW_FLAGGING=never \
27
  GRADIO_NUM_PORTS=1 \
 
56
  # ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/miniconda/lib"
57
 
58
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
59
+
60
  COPY --chown=user . $HOME/app
61
 
62
  CMD ["python3", "app.py"]