Akwbw commited on
Commit
5797184
·
verified ·
1 Parent(s): af3186f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -9
Dockerfile CHANGED
@@ -1,18 +1,36 @@
1
- FROM mcr.microsoft.com/playwright/python:v1.49.0-jammy
2
 
3
- WORKDIR /code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
7
 
8
- RUN playwright install chromium
 
 
9
 
 
10
  COPY . .
11
 
12
- # Permissions
13
- RUN mkdir -p /code/data && chmod -R 777 /code/data
14
 
 
15
  EXPOSE 7860
16
 
17
- # Streamlit Direct Run
18
- CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=7860", "--server.headless=true", "--server.fileWatcherType=none"]
 
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 \
7
+ xfce4-terminal \
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"]