Baskar2005 commited on
Commit
44e38e5
·
verified ·
1 Parent(s): 4cbd83c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -9
Dockerfile CHANGED
@@ -4,10 +4,7 @@ FROM mcr.microsoft.com/playwright/python:v1.41.0-jammy
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # 1. Install Xvfb (The Virtual Monitor) and other dependencies
8
- RUN apt-get update && apt-get install -y xvfb libx11-xcb1 libxcb-dri3-0 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libnss3 libcups2 libxss1 libxrandr2 libasound2 libpangocairo-1.0-0 libatk1.0-0 libatk-bridge2.0-0 libgtk-3-0
9
-
10
- # Copy requirements and install
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
@@ -17,12 +14,11 @@ RUN playwright install chromium
17
  # Copy all project files
18
  COPY . .
19
 
20
- # Grant permissions
21
  RUN chmod -R 777 /app
22
 
23
- # Expose the port
24
  EXPOSE 7860
25
 
26
- # 2. START COMMAND (Run Python inside the Virtual Monitor)
27
- # We use "xvfb-run" to create a fake screen before launching the app
28
- CMD ["xvfb-run", "--auto-servernum", "--server-args='-screen 0 1280x1024x24'", "python", "app.py"]
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy dependency file and install Python packages
 
 
 
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
 
14
  # Copy all project files
15
  COPY . .
16
 
17
+ # Grant permissions (Hugging Face needs this)
18
  RUN chmod -R 777 /app
19
 
20
+ # Expose the port Hugging Face expects
21
  EXPOSE 7860
22
 
23
+ # Run the application (Simple command)
24
+ CMD ["python", "app.py"]