- renderer: Node/Playwright, single browser + pooled contexts with concurrency
cap and FIFO queue, Redis render cache (graceful no-op without Redis)
- extractor: FastAPI + Trafilatura, HTML -> {title, text, metadata}
- orchestrator: /scrape (render -> extract) with per-stage trace, aggregated
/health, structured JSON logging on all services
- docker-compose for orchestrator/renderer/extractor/redis with healthchecks
Verified locally: end-to-end scrape of example.com and Wikipedia; error paths
for unreachable hosts and bad schemes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
11 lines
202 B
Docker
11 lines
202 B
Docker
FROM mcr.microsoft.com/playwright:v1.49.0-noble
|
|
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm install --omit=dev
|
|
|
|
COPY src ./src
|
|
|
|
ENV PORT=8002
|
|
EXPOSE 8002
|
|
CMD ["node", "src/server.js"]
|