1.7 KiB
1.7 KiB
Deployment — Coolify
Requirements
- A Coolify server (any host with Docker) and a git repository containing this project.
Steps
- Coolify → Projects → Add Service → Dockerfile (Git repository source).
- Point it at this repo; Coolify detects the
Dockerfileat the project root. - Port: publish container port
8030(or set envPORTand publish that). - Environment variables: none required — sensible defaults are baked in:
PORT=8030,DATA_DIR=/app/data.
- Persistence: add a volume for path
/app/data(Docker volume or S3/object storage) so uploaded EPUBs and generated PDFs survive deploys/restarts. - Healthcheck (Coolify settings):
GET /health, expect HTTP 200. - Domain/HTTPS: optional — attach a domain and Coolify's Traefik letsencrypt
will handle TLS. The app itself is plain HTTP and sends no cookies, so it
needs no special proxy config. Large uploads (up to 400 MB) work through the
default proxy; if you see timeouts on very large files, raise the Traefik
proxy send timeoutfor this service.
Notes / gotchas
- Single worker by design. The job registry (
JOBS) is in-memory; the Dockerfile runs gunicorn with--workers 1 --threads 8. Do not scale to multiple container instances unless you replace the in-memory registry with a shared store — polling/api/jobs/<id>would 404 on other instances. - WeasyPrint renders in-process, so CPU-heavy conversions occupy worker
threads;
--timeout 1200keeps long books from being killed by gunicorn. - CJK fonts (
fonts-noto-cjk) are installed in the image, so Chinese/Japanese /Korean books render correctly. - CLI mode also works inside the container for one-shots: `docker exec python app