Baskar2005 commited on
Commit
c6c98c6
·
verified ·
1 Parent(s): d376d1c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -15
Dockerfile CHANGED
@@ -1,24 +1,23 @@
1
- # Use the official Playwright image
2
- FROM mcr.microsoft.com/playwright/python:v1.41.0-jammy
 
 
 
 
 
3
 
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
 
11
- # Install Chromium
12
- RUN playwright install chromium
 
13
 
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"]
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies (wget, gnupg for Playwright)
4
+ RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ gnupg \
7
+ && rm -rf /var/lib/apt/lists/*
8
 
 
9
  WORKDIR /app
10
 
11
+ # Install Python deps
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Install Playwright Browsers
16
+ RUN pip install playwright
17
+ RUN playwright install --with-deps chromium
18
 
19
+ # Copy app code
20
  COPY . .
21
 
22
+ # Start Server (Render uses PORT env var)
23
+ CMD gunicorn app:app --bind 0.0.0.0:$PORT --timeout 120