derek-thomas HF staff commited on
Commit
5019d75
1 Parent(s): 4e1321d

Trying with USER

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -4,8 +4,14 @@ FROM python:3.9
4
  # Install Git LFS
5
  RUN apt-get update && apt-get install -y git-lfs
6
 
 
 
 
 
 
 
7
  # Set the working directory
8
- WORKDIR /app
9
 
10
  # Copy requirements.txt into the container
11
  COPY requirements.txt .
@@ -23,8 +29,8 @@ COPY . .
23
  COPY supervisord.conf .
24
 
25
  # Set permissions on the log file
26
- RUN touch /app/mylog.log /app/supervisord.log && chmod a+rwx /app/mylog.log /app/supervisord.log
27
- RUN mkdir -m 777 -p /.cache/huggingface/hub/
28
 
29
 
30
  # Expose the desired port
 
4
  # Install Git LFS
5
  RUN apt-get update && apt-get install -y git-lfs
6
 
7
+ # https://discuss.huggingface.co/t/permission-denied-for-writing-files-within-spaces/29799
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
+
13
  # Set the working directory
14
+ WORKDIR $HOME/app
15
 
16
  # Copy requirements.txt into the container
17
  COPY requirements.txt .
 
29
  COPY supervisord.conf .
30
 
31
  # Set permissions on the log file
32
+ RUN touch $HOME/app/mylog.log $HOME/app/supervisord.log && chmod a+rwx /app/mylog.log /app/supervisord.log
33
+ # RUN mkdir -m 777 -p /.cache/huggingface/hub/
34
 
35
 
36
  # Expose the desired port