Skip to content

Deploy

The repository ships a two-stage Dockerfile (build → runtime). The runtime image runs as a non-root user and listens on ${PORT:-8000}.

Build flags:

  • COMPILE_EXTRAS — comma-separated list. geom is required for marks / impose / trap; trap-gs adds the Ghostscript trap engine.
  • PRODUCERrewrite | marks | impose | trap | all. Selects which router(s) the runtime mounts via COMPILE_PRODUCER.

Production runs four producer services in one Railway project, plus shared infrastructure:

  • compile-rewrite, compile-marks, compile-impose, compile-trap — one container per producer.
  • compile-redis — Celery broker + cache backend.
  • compile-bucket — S3-compatible (or Tigris) object store for lineage records and output artifacts.

The marketing site lives in a sibling Railway project (compile-pdf-marketing) and includes its own compile-sidecar/ deployment that runs COMPILE_PRODUCER=all for demo traffic only — it never serves production jobs. See compile-pdf-marketing/compile-sidecar/railway.toml.

Set via COMPILE_AUTH_MODE:

ModeBehavior
noneNo auth (dev only)
bearerAuthorization: Bearer <token> header required
api-keyX-API-Key: <key> header required
internalSame-VPC traffic; honors X-Compile-Source provenance header
basicHTTP Basic; tenant/secret pair

Tokens / keys come from COMPILE_BEARER_TOKEN, COMPILE_API_KEY_LIST, COMPILE_BASIC_USER / COMPILE_BASIC_PASS. See .env.example.

VariablePurpose
COMPILE_PRODUCERWhich router(s) to mount (rewrite / marks / impose / trap / all)
COMPILE_AUTH_MODESee above
COMPILE_REDIS_URLCelery broker + cache backend
COMPILE_BUCKET_URLS3-compatible base URL for lineage
COMPILE_BUCKET_KEY / _SECRETBucket credentials
CODEX_API_BASELive Codex /v1/extract endpoint (used by version-skew check)
CODEX_BEARER_TOKENCodex auth
INSTANCE_IDOptional override; auto-generated as ULID otherwise
COMPILE_TRAP_ENGINEpure_python (default) / ghostscript / external — only honored on the trap container

Any change to codex-pdf — code, schema, image tag, or codex_pdf.version.VERSIONMUST cascade a redeploy of every Compile container that calls codex. See operations/multi-instance.md.