MoritzLaurer HF staff commited on
Commit
f5ff541
1 Parent(s): a657fe5

update dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -3
Dockerfile CHANGED
@@ -25,13 +25,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
25
  libsndfile-dev \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
- # Create a non-root user and switch to it
29
- RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
 
30
  && chown -R user:user /app
 
 
31
  RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
 
 
32
  USER user
33
 
34
- # All users can use /home/user as their home directory
35
  ENV HOME=/home/user
36
  RUN mkdir -p $HOME/.cache $HOME/.config /data \
37
  && chmod -R 777 $HOME /data
 
25
  libsndfile-dev \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
+ # Create the /app directory before changing ownership
29
+ RUN mkdir /app && \
30
+ adduser --disabled-password --gecos '' --shell /bin/bash user \
31
  && chown -R user:user /app
32
+
33
+ # Allow the user to run sudo commands without a password
34
  RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
35
+
36
+ # Switch to the non-root user
37
  USER user
38
 
39
+ # Set the user's home directory and configure permissions
40
  ENV HOME=/home/user
41
  RUN mkdir -p $HOME/.cache $HOME/.config /data \
42
  && chmod -R 777 $HOME /data