A docker image based on crawl4ai and python that help fetch web pages, avoiding generic bot blockers
411
A production-ready web page fetching microservice powered by Crawl4AI and Playwright. Fetches any webpage and returns cleaned Markdown or HTML — including links and images — with anti-bot detection bypass.
docker run -p 8000:8000 tamanois/web-fetcher:latest
Then:
curl "http://localhost:8000/fetch?url=https://example.com"
GET /fetchFetches a web page and returns its content.
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | required | URL-encoded target URL |
output_type | string | markdown | Output format: markdown or html |
max_chars | int | 60000 | Maximum characters in the response |
include_images | bool | false | Include image URLs and alt text |
include_links | bool | false | Include internal and external links |
bypass_anti_bot | bool | false | Enable anti-bot detection bypass |
GET /healthLightweight health check — does not touch the browser crawler.
{
"status": "ok",
"crawler_age_seconds": 142.3,
"crawler_max_age_seconds": 900
}
All settings are controlled via environment variables:
| Variable | Default | Description |
|---|---|---|
WEB_FETCHER_MAX_CONCURRENCY | 15 | Maximum simultaneous fetch requests |
WEB_FETCHER_REQUEST_TIMEOUT | 30 | HTTP-level request timeout in seconds |
WEB_FETCHER_CRAWLER_MAX_AGE | 900 | Recreate browser crawler after this many seconds to prevent memory leaks |
services:
web_fetcher:
image: tamanois/web-fetcher:latest
ports:
- "8000:8000"
restart: unless-stopped
environment:
- WEB_FETCHER_MAX_CONCURRENCY=10
- WEB_FETCHER_REQUEST_TIMEOUT=30
- WEB_FETCHER_CRAWLER_MAX_AGE=900
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512M
autoheal:
image: willfarrell/autoheal
restart: unless-stopped
environment:
- AUTOHEAL_CONTAINER_LABEL=all
- AUTOHEAL_START_PERIOD=60
- AUTOHEAL_INTERVAL=5
- AUTOHEAL_DEFAULT_STOP_TIMEOUT=30
volumes:
- /var/run/docker.sock:/var/run/docker.sock
autoheal to auto-restart on failureUndetectedAdapterContent type
Image
Digest
sha256:1d8441d33…
Size
1.1 GB
Last updated
3 months ago
docker pull tamanois/web-fetcher