> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dockiln.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

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

## Run locally

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.

```bash title="First local start" theme={null}
cp -n .env.example .env
docker compose up --build -d
curl -fsS http://localhost:3000/health
```

Open [the workspace](https://dockiln.io/app) 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.

## Publish the documentation

This documentation is hosted by Mintlify. Its content and `docs.json` live in the repository's `mintlify/` directory. Git settings must point to the configured publication branch and `/mintlify` subdirectory. Updates to that branch trigger a documentation deployment.

The application and rendering services deploy separately. Publishing documentation does not deploy application changes.

## Deploy the managed profile

| Service | Responsibility |
| - | - |
| Vercel | Static app 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.

## Verify and recover

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.

## Parity review configuration

Migrate the database before starting the 1.1 review services with automatic migration disabled. Keep `ENABLE_DYNAMIC_RENDERING=false` until the operator has verified the dedicated renderer’s network filter and resource limits. The API and renderer must both opt in.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.