Skip to content

Deployment

Run the full application on a single Docker host or split the web gateway from the rendering and storage services.

Start from the repository root with Docker and the Compose plugin installed. Create a private configuration file on first setup. For webhook signing secrets and customer S3 credentials, put a fresh 32-byte hex value in WEBHOOK_ENCRYPTION_KEY. Keep a backup of that key with your deployment secrets.

First local start
cp -n .env.example .env
docker compose up --build -d
curl -fsS http://localhost:3000/health

Open the workspace on the local origin. Compose starts the application, a worker and an isolated renderer. The app and worker share SQLite WAL and a document volume. The renderer uses a Unix socket and has no network interface for outbound requests. DOCKILN_PORT changes the published port; set APP_ORIGIN accordingly.

npm ci then npm run build builds the React application and the static documentation in dist/docs. The production server and Docker image serve these assets under /docs/. Search runs against a locally built index. The Vercel build uses the same pages and assets.

Service Responsibility
Vercel Static app and docs plus a same-origin gateway for API requests.
Cloud Run Gateway-protected API, private task worker and private isolated renderer.
PostgreSQL Tenants, credentials, templates, quota admissions, durable jobs and webhook outbox.
Cloud Storage Private workspace files served through authenticated downloads.
Cloud Tasks and Scheduler Authenticated dispatch and periodic reconciliation of missed handoffs.

The repository runbook at docs/cloud-deployment.md contains the account-side commands, IAM bindings, secret-version settings and release checks. From a checkout, bash scripts/cloud-run.sh plan prints the deployment sequence without changing cloud resources.

Run npm run migrate with a migration-authorized DATABASE_URL before starting cloud traffic. An unset URL selects SQLite. Set the cloud runtime to DB_AUTO_MIGRATE=false and give it a restricted PostgreSQL login. Keep the database, bucket and task queue close to the API and worker. Cloud Run’s local disk is ephemeral.

Check the public gateway health endpoint, then test an authenticated submission, status poll and private download. Confirm an unauthenticated request to the worker or renderer is rejected. The renderer must pass its network-filter startup check. Use the release probe in scripts/check-release.mjs from a disposable workspace to check an actual PDF and image on a managed deployment.

Back up application records, generated files and the matching encryption key. Stop writers before transferring state. The offline SQLite import in scripts/import-sqlite.mjs requires an empty target and verifies copied files. For single-host backup, restoration and customer S3 setup, see docs/deployment.md in the checkout.

Use the API reference for supported request fields and the PDFShift comparison for migration considerations. Test the supplied examples against your deployment before migrating production documents.