5. Build and initialize a fresh database
Run each command from the pinned source checkout on the VM. Use fresh volumes for this walkthrough. The initialization path is distinct from an upgrade or restore.
sudo docker compose --env-file deploy/postgres/.env \
-f deploy/postgres/compose.yaml --profile v2 build db platform
sudo docker compose --env-file deploy/postgres/.env \
-f deploy/postgres/compose.yaml up -d --wait db
sudo docker compose --env-file deploy/postgres/.env \
-f deploy/postgres/compose.yaml --profile setup run --rm migrate
sudo docker compose --env-file deploy/postgres/.env \
-f deploy/postgres/compose.yaml --profile setup run --rm bootstrap-roles
sudo docker compose --env-file deploy/postgres/.env \
-f deploy/postgres/compose.yaml --profile setup run --rm bootstrap-operator
The build selects the database image and the application image used by the platform service. Database startup initializes protected backup and archive directories. Migration prepares the schema, role bootstrap creates the service logins, and operator bootstrap enrolls the exact issuer and subject.
Require each step to exit successfully. Check the failed service or one-shot command output before retrying. For an existing deployment, use the release's documented upgrade or restore workflow with matching artifacts.