mirror of
https://github.com/Dvorinka/facr-scraper.git
synced 2026-06-03 20:12:57 +00:00
2.4 KiB
2.4 KiB
FACR Scraper - Coolify Deployment Guide
Summary
✅ Dockerized and ready for Coolify deployment
✅ Scrapling fully working in container
✅ All fallback methods functional
How it Works
The scraper uses a 4-tier fallback system:
- Direct HTTP requests (blocked by Cloudflare 403)
- wget fallback (also blocked)
- ✅ Scrapling with Playwright (bypasses Cloudflare - working!)
- Cloudflare Browser Rendering API (if configured)
Coolify Deployment
Option 1: Docker Compose (Recommended)
- Push code to your Git repository
- In Coolify, create new Docker Compose application
- Use the provided
docker-compose.yml - Set environment variables as needed
Option 2: Dockerfile
- Push code to Git repository
- In Coolify, create new Docker application
- Use the provided
Dockerfile - Set port mapping to
8686
Environment Variables
LOGOAPI_BASE_URL=https://logoapi.sportcreative.eu
CLOUDFLARE_ACCOUNT_ID=your_account_id # Optional
CLOUDFLARE_API_TOKEN=your_api_token # Optional
SCRAPLING_PYTHON_BIN=/opt/scrapling/bin/python
SCRAPLING_SCRIPT=/opt/scrapling/scripts/scrapling_fetch.py
DEBUG_SAVE_HTML= # Leave empty for production
Resource Requirements
- Minimum: 1 CPU, 1GB RAM
- Recommended: 2 CPU, 2GB RAM
- Storage: 2GB+ (for Playwright browsers)
Health Check
The container includes a built-in health check:
- Endpoint:
http://localhost:8686/ - Interval: 30s
- Timeout: 10s
Verification
After deployment, test:
curl https://your-domain.coolify.app/
curl https://your-domain.coolify.app/club/football/00000000-0000-0000-0000-000000000000
Performance Notes
- Cold start: ~10-15 seconds (Playwright initialization)
- Subsequent requests: ~2-5 seconds per page
- Concurrent scraping: Supported (each request independent)
- Rate limiting: Handled by fallback system
Troubleshooting
If Scrapling fails in production:
- Check logs for "Successfully retrieved content via Scrapling"
- Verify container has enough memory (>1GB)
- Ensure no outbound network restrictions
- Monitor Cloudflare protection changes
Files Created
Dockerfile- Multi-stage build with Go + Python/Playwrightdocker-compose.yml- Ready for Coolify deployment.dockerignore- Optimize build context
The Dockerized version maintains 100% feature parity with local development.