diff --git a/Dockerfile b/Dockerfile index b412cd8..8f52b45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM python:3.11-slim ARG TARGETPLATFORM ARG NODE_MAJOR=20 -# Install system dependencies +# Install system dependencies (removed libgconf-2-4) RUN apt-get update && apt-get install -y \ wget \ netcat-traditional \ @@ -12,7 +12,6 @@ RUN apt-get update && apt-get install -y \ curl \ unzip \ xvfb \ - libgconf-2-4 \ libxss1 \ libnss3 \ libnspr4 \ @@ -30,6 +29,8 @@ RUN apt-get update && apt-get install -y \ libxrandr2 \ xdg-utils \ fonts-liberation \ + fonts-noto-color-emoji \ + fonts-unifont \ dbus \ xauth \ x11vnc \ @@ -56,10 +57,10 @@ RUN mkdir -p /etc/apt/keyrings \ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ && apt-get update \ - && apt-get install nodejs -y \ + && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* -# Verify Node.js and npm installation (optional, but good for debugging) +# Verify Node.js and npm installation RUN node -v && npm -v && npx -v # Set up working directory @@ -67,26 +68,16 @@ WORKDIR /app # Copy requirements and install Python dependencies COPY requirements.txt . - RUN pip install --no-cache-dir -r requirements.txt -# Install playwright browsers and dependencies -# playwright documentation suggests PLAYWRIGHT_BROWSERS_PATH is still relevant -# or that playwright installs to a similar default location that Playwright would. -# Let's assume playwright respects PLAYWRIGHT_BROWSERS_PATH or its default install location is findable. +# Playwright setup ENV PLAYWRIGHT_BROWSERS_PATH=/ms-browsers RUN mkdir -p $PLAYWRIGHT_BROWSERS_PATH -# Install recommended: Google Chrome (instead of just Chromium for better undetectability) -# The 'playwright install chrome' command might download and place it. -# The '--with-deps' equivalent for playwright install is to run 'playwright install-deps chrome' after. -# RUN playwright install chrome --with-deps +# Install Chromium via Playwright without --with-deps +RUN PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 playwright install chromium -# Alternative: Install Chromium if Google Chrome is problematic in certain environments -RUN playwright install chromium --with-deps - - -# Copy the application code +# Copy application code COPY . . # Set up supervisor configuration @@ -96,4 +87,3 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf EXPOSE 7788 6080 5901 9222 CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] -#CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c7e3f18..97fdd2c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -68,7 +68,7 @@ services: - /tmp/.X11-unix:/tmp/.X11-unix # - ./my_chrome_data:/app/data/chrome_data # Optional: persist browser data restart: unless-stopped - shm_size: '2gb' + shm_size: "2gb" cap_add: - SYS_ADMIN tmpfs: @@ -77,4 +77,4 @@ services: test: ["CMD", "nc", "-z", "localhost", "5901"] # VNC port interval: 10s timeout: 5s - retries: 3 \ No newline at end of file + retries: 3