fix(deploy): update browser base image and resolve compose conflict

- Switch src/browser/Dockerfile to mcr.microsoft.com/playwright/python:v1.40.0-jammy
- Remove redundant shm_size and deprecated version key in docker-compose.yml
- Update documentation to reflect deployment fixes
This commit is contained in:
Luciabrightcode 2025-12-23 14:21:47 +08:00
parent 2bebeca84c
commit 180c8cb51a
4 changed files with 12 additions and 39 deletions

View file

@ -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

View file

@ -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`):

View file

@ -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"]

View file

@ -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.