Skip to main content
Everything on this page is defined in docker-compose.yml and docker/local/ in the repository.

Settings

Set these in the shell before running docker compose, or in a file named .env in the repository root. Compose reads that file only to fill in these values. Nothing else in it reaches the containers.
Set PARMANA_DB_PASSWORD to your own value before the first start. The default is public.
Setting PARMANA_BIND to anything other than 127.0.0.1 publishes the API over plain HTTP. Put a TLS terminating proxy in front of it first. The API key travels in every request.

Fixed server settings

The api service always runs with these values. They are set in docker-compose.yml. Any other server variable, for example a connector’s, is added as described in Connectors. Every variable the server reads is listed in the Environment variable reference.

Services

parmana-api:local is built from the repository’s Dockerfile by docker compose up --build.

setup

Runs docker/local/setup.mjs as root inside the image, then hands the files to uid 1000, the user the API runs as. On each start: If only one file of a key pair exists, it stops with an error and changes nothing, so a missing file never silently changes your signing key.

migrate

Runs docker/local/migrate.sh:
  1. Creates the roles anon, authenticated and service_role if they do not exist. Some migrations grant to them. They cannot log in.
  2. Creates the table parmana_schema_migrations if it does not exist.
  3. For each file in supabase/migrations/, in filename order, that is not listed in that table: applies it and records it, in one transaction. A migration that fails changes nothing, the service exits with an error, and the API does not start.
It prints [migrate] <n> applied, <m> already applied.

seed

Runs docker/local/seed-policies.mjs. For every policy version under policies/ in the image, it inserts the version into the policies table if that name and version are not there yet. It never changes an existing row. It prints [seed-policies] <n> policies in the image, <a> added, <k> already present and kept. A seeded policy is not approved. Until two people approve it, a request under it is refused. See Approve a policy.

api

The Parmana server, unchanged from the hosted API. The health check calls GET /ready every 10 seconds and marks the container healthy when it returns "status":"READY".

Files in ./parmana-local

On Linux these files belong to uid 1000. Read them through a container, as the pages of this guide show, or as root. ./parmana-local is listed in .gitignore and .dockerignore, so it is never committed and never copied into an image.
Deleting ./parmana-local deletes your signing keys. Records already signed still verify with the public keys, if you kept them. The next start makes new keys, and new records are signed with those.

Volumes and ports

Helper scripts

All run inside the API image through the setup service, so the host needs only Docker: