Docker
Run the engine as a container with Postgres and a mail catcher, for development or production.
On this page
The repository has a docker-compose.yml that runs everything on one machine: Postgres 16, the engine and Mailpit, which catches every e-mail so you can read sign-up and password links locally.
Start
git clone https://github.com/sespinosav/sypnia-data && cd sypnia-data
cp .env.example .envFill the two secrets in .env, generating them on your machine:
openssl rand -base64 32 # SYPNIA_DATA_MASTER_KEY: keep it safe, without it every session ends
openssl rand -base64 24 # POSTGRES_PASSWORDdocker compose up -d
docker compose ps # db, mailpit and data become healthy
curl http://localhost:8080/healthOn its first start the engine installs its schema in the database (it waits until Postgres is ready). After an upgrade it applies the new migrations before it serves. Both come from SYPNIA_DATA_INSTALL_ON_START=true.
Keys and a first user
docker compose exec data sypnia-data keys api-key --kind publishable # for your app (browser-safe)
docker compose exec data sypnia-data keys api-key --kind secret # for your servers; shown once
docker compose exec -e SYPNIA_DATA_NEW_PASSWORD='a long passphrase' data sypnia-data users create ana@example.comSign-ups, magic links and password resets land in Mailpit at http://localhost:8025.
What runs
| Service | Image | Port | Notes |
|---|---|---|---|
db | postgres:16-bookworm | inside only | data in the pgdata volume |
mailpit | axllent/mailpit:v1.27 | 127.0.0.1:8025 | the web UI; SMTP on mailpit:1025 inside |
data | ghcr.io/sespinosav/sypnia-data:${SYPNIA_DATA_VERSION} | 127.0.0.1:8080 | auth, Data API, SQL, and MCP at /mcp |
The engine’s image is distroless and runs as a non-root user. It is built for linux/amd64 and linux/arm64, and its healthcheck is sypnia-data health. Compose caps each container’s memory.
Production
- TLS in front. The engine speaks plain HTTP on port 8080. Put Caddy, nginx, Traefik or your cloud’s load balancer in front, and forward the
Hostheader: the engine uses it to pick the project and to build links in e-mails. - Your address. Set
SYPNIA_DATA_PUBLIC_URLto the address people reach (https://api.myapp.com). - A real mail provider. Replace Mailpit with
SYPNIA_DATA_MAIL=smtp|resend|postmark|ses(configuration). - Pin a version. Use
SYPNIA_DATA_VERSION=0.1.0, neverlatest. - Keep the master key out of files. In production, keep
SYPNIA_DATA_MASTER_KEYin a secrets manager rather than in.env. - Replicas. Two replicas behind the proxy share nothing but the database.
- Logs. They go to stdout as JSON lines with a request id; secrets are never logged.
Upgrading is in Upgrades and backups.