diff --git a/docker-compose.yml b/docker-compose.yml index 4081d9c..3d376c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.8' - services: orchestrator: build: @@ -35,7 +33,7 @@ services: # - BROWSERFORGE_SEED=... depends_on: - redis - shm_size: 2gb + volumes: - .:/app - /dev/shm:/dev/shm diff --git a/implementation_plan.md b/implementation_plan.md index 0ba0aa9..205215b 100644 --- a/implementation_plan.md +++ b/implementation_plan.md @@ -15,6 +15,8 @@ Transition the system from a functional prototype to a scalable, production-read - Scaled `camoufox-pool` to 5 replicas. - Scaled `curl-pool` to 20 replicas. - Added `prometheus` and `grafana` services. + - Cleaned up `version` and `shm_size` fields. +- **Dockerfile**: Updated `src/browser/Dockerfile` to use `mcr.microsoft.com/playwright/python:v1.40.0-jammy`. ### Core Tier (Orchestration & Monitoring) - **MetricsCollector** (`src/core/monitoring.py`): diff --git a/src/browser/Dockerfile b/src/browser/Dockerfile index b0384b8..94196c3 100644 --- a/src/browser/Dockerfile +++ b/src/browser/Dockerfile @@ -1,46 +1,17 @@ -FROM python:3.11-slim +FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy WORKDIR /app -# Install system dependencies for Playwright/Camoufox -RUN apt-get update && apt-get install -y --no-install-recommends \ - curl \ - git \ - # WebKit/Chromium dependencies for Playwright - libwoff1 \ - libopus0 \ - libwebp6 \ - libwebpdemux2 \ - libenchant-2-2 \ - libgudev-1.0-0 \ - libsecret-1-0 \ - libhyphen0 \ - libgdk-pixbuf2.0-0 \ - libegl1 \ - libnotify4 \ - libxslt1.1 \ - libevent-2.1-7 \ - libgles2 \ - libvpx7 \ - libxcomposite1 \ - libatk1.0-0 \ - libatk-bridge2.0-0 \ - libepoxy0 \ - libgtk-3-0 \ - libharfbuzz-icu0 \ - libgstreamer-gl1.0-0 \ - libgstreamer-plugins-bad1.0-0 \ - gstreamer1.0-plugins-good \ - gstreamer1.0-libav \ - && rm -rf /var/lib/apt/lists/* +# Base image already includes all dependencies + browsers. +# Just install Python requirements. COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -# Install Playwright browsers (Specifically Chromium/Firefox as needed) -# Camoufox typically uses its own patched browser or relies on Playwright's firefox. -RUN playwright install chromium firefox - +# Copy application source COPY . . +# Set PYTHONPATH to root so 'src' module is resolvable +ENV PYTHONPATH=/app + CMD ["python", "-m", "src.browser.manager"] diff --git a/walkthrough.md b/walkthrough.md index 8b0b9e8..410b130 100644 --- a/walkthrough.md +++ b/walkthrough.md @@ -105,6 +105,8 @@ tests/unit/test_session_core.py .. [100%] ### 2. Implementation Results - **Infrastructure**: Updated `docker-compose.yml` with scaling strategies and monitoring stack. + - switched `camoufox-pool` base image to Microsoft Playwright Jammy for stability. + - Removed `shm_size` conflict and legacy version tag. - **Worker**: Implemented `src/orchestrator/worker.py` for continuous task processing. - **Monitoring**: Implemented `src/core/monitoring.py` exposing metrics on port 8000. - **Documentation**: Updated `README.md` with production operations guide.