Deploy to production
The production path is Docker Compose: PostgreSQL, Redis, the backend, the frontend, and a Caddy edge with TLS. No local toolchain is needed.
Requirements
Section titled “Requirements”Docker with Compose. That is all.
-
Clone this repository and create the environment file:
Terminal window cp docker/.env.example docker/.envFill in the values — public hostname, SMTP relay, secrets. The file documents each key.
-
Build and start the stack:
Terminal window docker compose -f docker/compose.prod.yml up -d --buildThe backend entrypoint applies migrations and seeds the core schema on every boot. No manual schema step.
-
Create the first administrator:
Terminal window docker compose -f docker/compose.prod.yml exec backend facet seed:admin ops@your-company.tldThe command prints a one-time password. It is shown once — record it in a password manager.
-
Open
https://<your-hostname>(default:https://facet.localhost:3443), sign in with the one-time password, and set a real password when prompted.That address is the Caddy edge port.
HTTPS_PORTindocker/.envsets it (default3443). The backend listens on3000inside the Docker network, and the edge proxies to it. Port3000is not published on the host.
What to know in production
Section titled “What to know in production”- Migrations are embedded in the binary. A deployed binary needs no
db/tree on disk. After the first release, the migration directory is append-only — never edit an applied migration file. - Timestamps are stored as UTC. The schema stores tz-naive UTC values. The
application pins its PostgreSQL session to UTC. A client that connects with a
different role (psql, BI tools) must set
TimeZone=UTCitself, or writes skew by the session offset. - Redis is required. The event bus, sessions, OAuth codes, and rate limits use it. PostgreSQL holds the durable state; Redis is the reaction bus.
Reference
Section titled “Reference”- Deploying with containers — images, tags, config mounting, and the TLS edge.
- Configuration files — every key the config file takes.
- Bootstrap and CLI tasks — the commands behind step 3.
- Database migrations — what the entrypoint runs at boot.
- Runbooks in the repository: first-deployment.md, container-images.md.