Spaces:
Running
Running
Trisha Tomy
commited on
Commit
·
9459102
1
Parent(s):
4f40e92
removed debug
Browse files- Dockerfile +5 -13
Dockerfile
CHANGED
@@ -4,9 +4,8 @@ FROM mcr.microsoft.com/playwright/python:v1.53.0-noble
|
|
4 |
# Set the working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# The official Playwright image comes with most necessary system dependencies
|
8 |
-
#
|
9 |
-
# Removing the extensive list as it's largely redundant with the Playwright base image.
|
10 |
RUN apt-get update && apt-get install -y \
|
11 |
git \
|
12 |
xvfb \
|
@@ -41,20 +40,13 @@ RUN mkdir -p /app/src/proxy-lite/local_trajectories \
|
|
41 |
# Set environment variables required for Playwright at runtime
|
42 |
ENV DISPLAY=:99
|
43 |
ENV XDG_RUNTIME_DIR=/tmp
|
44 |
-
# Removed PLAYWRIGHT_BROWSERS_PATH and PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD
|
45 |
-
# as the official Playwright image manages these internally, defaulting to /ms-playwright.
|
46 |
|
47 |
-
#
|
48 |
-
|
49 |
-
RUN python -m playwright --version
|
50 |
-
RUN echo "--- Listing Playwright Browser Cache (Recursive, from base image) ---"
|
51 |
-
RUN ls -alR /ms-playwright/
|
52 |
-
RUN echo "-----------------------------------"
|
53 |
-
# --- End Debugging ---
|
54 |
|
55 |
# Expose the port your Flask app will listen on. Hugging Face Spaces requires 7860.
|
56 |
EXPOSE 7860
|
57 |
|
58 |
# Define the command to run your Flask application using Gunicorn for production.
|
59 |
-
#
|
60 |
CMD ["xvfb-run", "gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--worker-class", "gevent", "app:app", "--timeout", "300"]
|
|
|
4 |
# Set the working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# The official Playwright image comes with most necessary system dependencies.
|
8 |
+
# We only need to add git and xvfb (if not already present and needed for xvfb-run in CMD).
|
|
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
git \
|
11 |
xvfb \
|
|
|
40 |
# Set environment variables required for Playwright at runtime
|
41 |
ENV DISPLAY=:99
|
42 |
ENV XDG_RUNTIME_DIR=/tmp
|
|
|
|
|
43 |
|
44 |
+
# Removed redundant Playwright installation and debugging commands
|
45 |
+
# The base image already includes Playwright and its browsers.
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
# Expose the port your Flask app will listen on. Hugging Face Spaces requires 7860.
|
48 |
EXPOSE 7860
|
49 |
|
50 |
# Define the command to run your Flask application using Gunicorn for production.
|
51 |
+
# xvfb-run is still needed if Playwright is launched in non-headless mode in app.py
|
52 |
CMD ["xvfb-run", "gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--worker-class", "gevent", "app:app", "--timeout", "300"]
|