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:
parent
2bebeca84c
commit
180c8cb51a
4 changed files with 12 additions and 39 deletions
|
|
@ -1,5 +1,3 @@
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
orchestrator:
|
orchestrator:
|
||||||
build:
|
build:
|
||||||
|
|
@ -35,7 +33,7 @@ services:
|
||||||
# - BROWSERFORGE_SEED=...
|
# - BROWSERFORGE_SEED=...
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
shm_size: 2gb
|
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
- /dev/shm:/dev/shm
|
- /dev/shm:/dev/shm
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ Transition the system from a functional prototype to a scalable, production-read
|
||||||
- Scaled `camoufox-pool` to 5 replicas.
|
- Scaled `camoufox-pool` to 5 replicas.
|
||||||
- Scaled `curl-pool` to 20 replicas.
|
- Scaled `curl-pool` to 20 replicas.
|
||||||
- Added `prometheus` and `grafana` services.
|
- 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)
|
### Core Tier (Orchestration & Monitoring)
|
||||||
- **MetricsCollector** (`src/core/monitoring.py`):
|
- **MetricsCollector** (`src/core/monitoring.py`):
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,17 @@
|
||||||
FROM python:3.11-slim
|
FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies for Playwright/Camoufox
|
# Base image already includes all dependencies + browsers.
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
# Just install Python requirements.
|
||||||
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/*
|
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Install Playwright browsers (Specifically Chromium/Firefox as needed)
|
# Copy application source
|
||||||
# Camoufox typically uses its own patched browser or relies on Playwright's firefox.
|
|
||||||
RUN playwright install chromium firefox
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Set PYTHONPATH to root so 'src' module is resolvable
|
||||||
|
ENV PYTHONPATH=/app
|
||||||
|
|
||||||
CMD ["python", "-m", "src.browser.manager"]
|
CMD ["python", "-m", "src.browser.manager"]
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,8 @@ tests/unit/test_session_core.py .. [100%]
|
||||||
|
|
||||||
### 2. Implementation Results
|
### 2. Implementation Results
|
||||||
- **Infrastructure**: Updated `docker-compose.yml` with scaling strategies and monitoring stack.
|
- **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.
|
- **Worker**: Implemented `src/orchestrator/worker.py` for continuous task processing.
|
||||||
- **Monitoring**: Implemented `src/core/monitoring.py` exposing metrics on port 8000.
|
- **Monitoring**: Implemented `src/core/monitoring.py` exposing metrics on port 8000.
|
||||||
- **Documentation**: Updated `README.md` with production operations guide.
|
- **Documentation**: Updated `README.md` with production operations guide.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue