# Production guide and restore drill

A production guide with dated prices, Worker placement set by pnpm setup, a production mode for the job tick on Node, and a monthly restore drill on a throwaway local database.

<Callout title="Action: set the Worker placement for your database">
Run `pnpm run setup --placement aws:sa-east-1` (or your database's `<provider>:<region>`, or `smart`) once per project. The template still ships `aws:us-east-2`, the region of its own database. See [Worker placement](/docs/production#worker-placement).
</Callout>

- **A production guide.** [/docs/production](/docs/production) covers Neon in São Paulo (`aws-sa-east-1`, fixed when the project is created), Launch versus Scale, why the one-minute cron keeps the compute awake, Worker placement, a monthly cost table with every price's source and reading date, running on a Node server or Google Cloud instead, backups, and monitoring a VPS. [Deployment and rollback](/docs/deploy) links to it. [Commit](https://github.com/CarlosZiegler/template-cloudflare/commit/3dbdc75f)
- **`pnpm setup --placement`.** Setup writes `placement` into `apps/web/wrangler.jsonc`, keeps it for reruns, takes the region from a Neon `--hyperdrive-db-url`, and asks for it in the interactive wizard. It never reads the local `DATABASE_URL`. [Commit](https://github.com/CarlosZiegler/template-cloudflare/commit/4e663160)
- **`pnpm jobs:run --once --production`** runs the job tick on a Node server from a system timer. It reads only its own environment, never `apps/web/.env`, logs the same `jobs.tick` line as the Worker and exits 1 when the tick fails. See [scheduled jobs on Node](/docs/production#scheduled-jobs-on-node). [Commit](https://github.com/CarlosZiegler/template-cloudflare/commit/8319b260)
- **`node scripts/restore-drill.mjs <dump>`** restores a dump into a throwaway local PostgreSQL started by `scripts/test-local-postgres.mjs`. It runs `db:verify-rls`, counts the rows of every table, prints timings and the age of the newest row, and ends with one `restore_drill` JSON line for the alert channel. See [restore drill](/docs/production#restore-drill). [Commit](https://github.com/CarlosZiegler/template-cloudflare/commit/6928c8d4)

[PR #213](https://github.com/CarlosZiegler/template-cloudflare/pull/213)
