Operations · 0.8.1

Prod-local: running the application in Docker

Prepare a local environment, run the application over HTTPS, and create an administrator.

On this page

In prod-local, the backend, admin interface, and PostgreSQL run in Docker. The interface and API are available over HTTPS. This is a separate environment with its own database and images.

In the commands below, ENV_NAME is a shell variable containing the profile name from Deployment environments, not the project name or preset. At the start of each block, replace production, local, or dev with your profile name, for example ENV_NAME=test. Commands use "$ENV_NAME" so --env and its confirmation receive the same value. Set the variable again when switching machines or opening a new terminal.

The example names the environment local. Run commands from the generated project root.

1. Prepare tools and files

You need Bash, jq, and running Docker with Compose and Buildx. Docker client and server must support API 1.49+ and image inspect --platform; enable containerd image store for local images.

Open Deployment in Generator UI and enable Docker and Production deployment. CI provider can remain None. Save and run Generate.

2. Create a local profile in UI

In Deployment → Deployment environments, enter New profile name: local, select Local production (Docker), and click Add profile.

Keep domains admin.local.test and api.local.test, and ports 8443 and 9443 if free. Allowed HTTPS origins must contain https://admin.local.test:8443. Runtime directory, local media directory, and local backup directory are calculated from the project folder: no manual absolute paths are needed. Prod-local backups remain local.

If the project uses S3, fill in its profile parameters following S3 setup. The storage adapter is shared across the project.

Click Save deployment settings, then Generate. The profile appears in deploy/generated/environments/local.json; leave the empty deploy/custom/environments/local.json unchanged for now. You do not need to copy an example into deploy/environments/. If local.json already exists there, import it into UI and remove the manual file after saving and generation: otherwise it continues to override the profile.

3. Add local addresses

Add a line to the OS hosts file. On macOS/Linux it is /etc/hosts; editing requires administrator permissions:

127.0.0.1 admin.local.test api.local.test

Free ports 8443 and 9443 if another application uses them.

4. Prepare and start the environment

Run commands in order, waiting for each to finish successfully:

ENV_NAME=local # replace with your exact profile name in Deployment environments
bash ./deploy/control provision --env "$ENV_NAME"
bash ./deploy/control up --env "$ENV_NAME"
bash ./deploy/control status --env "$ENV_NAME" --json

provision builds images and creates directories, keys, and local certificates. up applies migrations and starts the application. status shows the current release and component readiness.

If a command fails, investigate it using operation recovery. Do not delete deploy/.state/local: it contains environment data.

5. Open the interface

The admin interface address is https://admin.local.test:8443; the API is https://api.local.test:9443.

Add deploy/.state/local/pki/ui-ca.crt to trusted certificates in your OS or browser. This is the local certificate authority's public certificate; do not import the private key. Without trust configuration, the browser displays a certificate warning.

6. Create the first superadministrator

List running container names:

docker ps --format 'table {{.Names}}\t{{.Status}}'

Find the backend for the local environment specifically: its name usually contains the project name, local, and backend. Copy its name and substitute it for ИМЯ_КОНТЕЙНЕРА:

docker exec -it ИМЯ_КОНТЕЙНЕРА admin bootstrap-superadmin --if-needed --login owner

Enter and repeat a password of 12–128 UTF-8 bytes. Input is hidden. If an active superadministrator already exists, the command creates nothing. Sign in with this account: the Generator UI account does not apply here.

Stopping and restarting

ENV_NAME=local # replace with your exact profile name in Deployment environments
bash ./deploy/control down --env "$ENV_NAME"
bash ./deploy/control up --env "$ENV_NAME"

Stopping preserves the database, images, and history. up starts the recorded version rather than building changed source code.

Open logs with:

ENV_NAME=local # replace with your exact profile name in Deployment environments
bash ./deploy/control logs --env "$ENV_NAME" --service backend

frontend and postgres are also available instead of backend.

Updating

After changing the model, run Generate, then build and apply a new version:

ENV_NAME=local # replace with your exact profile name in Deployment environments
bash ./deploy/control build --env "$ENV_NAME" --output local-release-02.json
bash ./deploy/control deploy --env "$ENV_NAME" --release local-release-02.json --confirm "$ENV_NAME"

The build command creates local-release-02.json. Do not write it manually; choose a new name for the next build. See application update.