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

update dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -25,10 +25,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
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
@@ -36,10 +37,9 @@ RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
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
43
 
44
  # Set the working directory to /app
45
  WORKDIR /app
 
25
  libsndfile-dev \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
+ # Create the /app and /data directories and set permissions before switching to the non-root user
29
+ RUN mkdir -p /app /data && \
30
+ chmod -R 777 /data && \
31
+ adduser --disabled-password --gecos '' --shell /bin/bash user && \
32
+ chown -R user:user /app
33
 
34
  # Allow the user to run sudo commands without a password
35
  RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
 
37
  # Switch to the non-root user
38
  USER user
39
 
40
+ # Set the user's home directory and configure permissions for home directories
41
  ENV HOME=/home/user
42
+ RUN mkdir -p $HOME/.cache $HOME/.config && chmod -R 777 $HOME
 
43
 
44
  # Set the working directory to /app
45
  WORKDIR /app