docker-compose.yml and docker/local/ in the repository.
Settings
Set these in the shell before runningdocker 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.
Fixed server settings
Theapi 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:
- Creates the roles
anon,authenticatedandservice_roleif they do not exist. Some migrations grant to them. They cannot log in. - Creates the table
parmana_schema_migrationsif it does not exist. - 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.
[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.
Volumes and ports
Helper scripts
All run inside the API image through thesetup service, so the host needs only Docker: