SalHargis commited on
Commit
5714937
·
verified ·
1 Parent(s): 815324a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -17
Dockerfile CHANGED
@@ -1,8 +1,6 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
 
4
- # Install system dependencies for Tkinter and GUI support
5
- # scrot is needed for ImageGrab on Linux
6
  RUN apt-get update && apt-get install -y \
7
  python3-tk \
8
  xvfb \
@@ -11,26 +9,25 @@ RUN apt-get update && apt-get install -y \
11
  novnc \
12
  net-tools \
13
  scrot \
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Set up the working directory
17
  WORKDIR /app
18
 
19
- # Copy the requirements file into the container
20
- COPY requirements.txt .
21
 
22
- # Install Python dependencies
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # Copy the rest of the application code
26
- COPY . .
27
-
28
- # Create a start script to launch the GUI and the VNC server
29
- COPY start.sh .
30
- RUN chmod +x start.sh
31
 
32
- # Expose the port used by NoVNC
33
- EXPOSE 7860
 
 
 
34
 
35
- # Run the start script
36
  CMD ["./start.sh"]
 
1
+ FROM python:3.9
 
2
 
3
+ # Install system dependencies
 
4
  RUN apt-get update && apt-get install -y \
5
  python3-tk \
6
  xvfb \
 
9
  novnc \
10
  net-tools \
11
  scrot \
12
+ dos2unix \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Set up work directory
16
  WORKDIR /app
17
 
18
+ # Copy files
19
+ COPY . .
20
 
21
+ # Install Python requirements
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
+ # CRITICAL FIX: Fix permissions and line endings for start.sh
25
+ RUN chmod +x start.sh && dos2unix start.sh
 
 
 
 
26
 
27
+ # User settings
28
+ RUN useradd -m -u 1000 user
29
+ USER user
30
+ ENV HOME=/home/user \
31
+ PATH=/home/user/.local/bin:$PATH
32
 
 
33
  CMD ["./start.sh"]