Akwbw commited on
Commit
65a3f95
·
verified ·
1 Parent(s): b6e362a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -8
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM ubuntu:22.04
2
 
3
- # 1. Install Desktop Environment & Tools (No Interaction Mode)
4
  ENV DEBIAN_FRONTEND=noninteractive
5
  RUN apt-get update && apt-get install -y \
6
  xfce4 \
@@ -8,29 +8,36 @@ RUN apt-get update && apt-get install -y \
8
  xvfb \
9
  python3 \
10
  python3-pip \
 
 
11
  scrot \
12
  chromium-browser \
13
  wget \
14
  curl \
15
  unzip \
16
  zip \
 
17
  && apt-get clean
18
 
19
- # 2. Setup Working Directory
20
  WORKDIR /app
21
 
22
- # 3. Install Python Libraries
23
  COPY requirements.txt .
24
  RUN pip3 install --no-cache-dir -r requirements.txt
25
 
26
- # 4. Copy App Code
 
 
 
27
  COPY . .
28
 
29
- # 5. Permissions
 
30
  RUN chmod -R 777 /app
31
 
32
- # 6. Expose Port
33
  EXPOSE 7860
34
 
35
- # 7. Start Command (Xvfb Virtual Screen + Flask App)
36
- CMD ["sh", "-c", "Xvfb :99 -screen 0 1024x768x16 & export DISPLAY=:99 && startxfce4 & python3 app.py"]
 
1
  FROM ubuntu:22.04
2
 
3
+ # 1. Install System Tools & Desktop
4
  ENV DEBIAN_FRONTEND=noninteractive
5
  RUN apt-get update && apt-get install -y \
6
  xfce4 \
 
8
  xvfb \
9
  python3 \
10
  python3-pip \
11
+ python3-tk \
12
+ python3-dev \
13
  scrot \
14
  chromium-browser \
15
  wget \
16
  curl \
17
  unzip \
18
  zip \
19
+ x11-utils \
20
  && apt-get clean
21
 
22
+ # 2. Setup Directory
23
  WORKDIR /app
24
 
25
+ # 3. Python Libs
26
  COPY requirements.txt .
27
  RUN pip3 install --no-cache-dir -r requirements.txt
28
 
29
+ # 4. Set Display Environment Variable (CRITICAL FIX)
30
+ ENV DISPLAY=:99
31
+
32
+ # 5. Copy Files
33
  COPY . .
34
 
35
+ # 6. Permissions for start script
36
+ RUN chmod +x start.sh
37
  RUN chmod -R 777 /app
38
 
39
+ # 7. Expose Port
40
  EXPOSE 7860
41
 
42
+ # 8. Run the Startup Script
43
+ CMD ["/bin/bash", "start.sh"]