From c099faac9f24e44ca36dcae63ed53ab10f6b654b Mon Sep 17 00:00:00 2001 From: Aira Catapang Date: Thu, 2 Apr 2026 04:32:57 +0000 Subject: [PATCH] Update Dockerfile --- Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2168980..3ae99cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,20 @@ -FROM mcr.microsoft.com/playwright/python:v1.58.0-jammy +# Use the official Playwright image which includes all browser dependencies +FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy WORKDIR /app +# Install Xvfb (Virtual Display) +RUN apt-get update && apt-get install -y xvfb + +# Install Python requirements COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +# Copy your application code COPY . . -ENV HEADLESS="true" -ENV PORT=7860 +# Set environment variable to run Headful +ENV HEADLESS="false" -EXPOSE $PORT - -CMD ["python", "main.py"] \ No newline at end of file +# Run Uvicorn wrapped in Xvfb (This simulates a monitor so Playwright thinks it's a real computer) +CMD xvfb-run -a uvicorn main:app --host 0.0.0.0 --port 7860 \ No newline at end of file