Baskar2005 commited on
Commit
2b81d4d
·
verified ·
1 Parent(s): 43ed985

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -16
Dockerfile CHANGED
@@ -1,22 +1,23 @@
1
- FROM python:3.10-slim
2
-
3
- # Install system dependencies
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
- # Copy files
12
- COPY requirements.txt .
13
- RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Install Playwright and Browsers
16
- RUN pip install playwright
17
- RUN playwright install --with-deps chromium
18
 
19
- COPY . .
 
 
 
 
 
 
 
20
 
21
- # Use ${PORT:-10000} to prevent the "Error: '' is not a valid port number"
22
- CMD gunicorn app:app --bind 0.0.0.0:${PORT:-10000} --timeout 120
 
1
+ # Use official Playwright Python image (includes Chromium + deps)
2
+ FROM mcr.microsoft.com/playwright/python:v1.42.0-jammy
 
 
 
 
 
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy project files
8
+ COPY . .
 
9
 
10
+ # Install Python dependencies
11
+ RUN pip install --no-cache-dir flask playwright
 
12
 
13
+ # Install Playwright browsers (already included, but safe)
14
+ RUN playwright install chromium
15
+
16
+ # Expose Flask port
17
+ EXPOSE 5000
18
+
19
+ # Prevent Flask from using reloader inside Docker
20
+ ENV FLASK_ENV=production
21
 
22
+ # Run the app
23
+ CMD ["python", "app.py"]