SalHargis commited on
Commit
ce18556
·
verified ·
1 Parent(s): 84c86ea

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -7
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.9
2
 
3
- # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  python3-tk \
6
  xvfb \
@@ -11,22 +11,29 @@ RUN apt-get update && apt-get install -y \
11
  scrot \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Set up work directory
15
  WORKDIR /app
16
 
17
- # Copy files
18
  COPY . .
19
 
20
- # Install Python requirements
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # FORCE PERMISSIONS: Make the script executable
 
 
 
 
 
 
24
  RUN chmod +x start.sh
 
25
 
26
- # User settings (Hugging Face requirements)
27
- RUN useradd -m -u 1000 user
28
  USER user
29
  ENV HOME=/home/user \
30
  PATH=/home/user/.local/bin:$PATH
31
 
 
32
  CMD ["./start.sh"]
 
1
  FROM python:3.9
2
 
3
+ # 1. Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  python3-tk \
6
  xvfb \
 
11
  scrot \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # 2. Set up work directory
15
  WORKDIR /app
16
 
17
+ # 3. Copy files (They are currently owned by Root)
18
  COPY . .
19
 
20
+ # 4. Install Python requirements
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # 5. Create the standard user
24
+ RUN useradd -m -u 1000 user
25
+
26
+ # --- CRITICAL FIX IS HERE ---
27
+ # Transfer ownership of all files from Root to User
28
+ RUN chown -R user:user /app
29
+ # Make the start script executable
30
  RUN chmod +x start.sh
31
+ # ----------------------------
32
 
33
+ # 6. Switch to the user
 
34
  USER user
35
  ENV HOME=/home/user \
36
  PATH=/home/user/.local/bin:$PATH
37
 
38
+ # 7. Start the app
39
  CMD ["./start.sh"]