Trisha Tomy commited on
Commit
1866907
·
1 Parent(s): 9459102

removed debug

Browse files
Files changed (2) hide show
  1. Dockerfile +15 -7
  2. app.py +1 -1
Dockerfile CHANGED
@@ -4,8 +4,9 @@ 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
- # 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,13 +41,20 @@ RUN mkdir -p /app/src/proxy-lite/local_trajectories \
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"]
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # The official Playwright image comes with most necessary system dependencies,
8
+ # so we only need to add git for proxy-lite and potentially any very specific missing libs.
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
  # 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
+ # --- Debugging: Check Playwright version and browser installation (moved AFTER install in the original setup) ---
48
+ # Now checking the default Playwright browser installation path /ms-playwright
49
+ RUN echo "--- Checking Playwright Version (from base image) ---"
50
+ RUN python -m playwright --version
51
+ RUN echo "--- Listing Playwright Browser Cache (Recursive, from base image) ---"
52
+ RUN ls -alR /ms-playwright/
53
+ RUN echo "-----------------------------------"
54
+ # --- End Debugging ---
55
 
56
  # Expose the port your Flask app will listen on. Hugging Face Spaces requires 7860.
57
  EXPOSE 7860
58
 
59
  # Define the command to run your Flask application using Gunicorn for production.
60
+ CMD exec gunicorn --bind 0.0.0.0:7860 --workers 2 --worker-class gevent app:app --timeout 300
 
app.py CHANGED
@@ -27,7 +27,7 @@ async def initialize_runner():
27
  "environment": {
28
  "name": "webbrowser",
29
  "homepage": "https://www.google.com",
30
- "headless": False,
31
  "launch_args": ["--no-sandbox", "--disable-setuid-sandbox"]
32
  },
33
  "solver": {
 
27
  "environment": {
28
  "name": "webbrowser",
29
  "homepage": "https://www.google.com",
30
+ "headless": True,
31
  "launch_args": ["--no-sandbox", "--disable-setuid-sandbox"]
32
  },
33
  "solver": {