Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +17 -16
Dockerfile
CHANGED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
-
|
| 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
|
| 13 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
-
# Install
|
| 16 |
-
RUN pip install playwright
|
| 17 |
-
RUN playwright install --with-deps chromium
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
CMD
|
|
|
|
| 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"]
|