Prerequisites
- Docker Engine 20.10 or later
- Docker Compose v2 (
docker composecommand, notdocker-compose) - A running PostgreSQL instance (version 16 recommended) accessible from the containers
- Git
Services
Thedocker-compose.yml file defines the following services:
Service startup order
Thedepends_on declarations in docker-compose.yml define the following boot sequence:
agent-service additionally waits for agent-provisioning to log "Agent-Provisioning-Service Microservice is listening to NATS" before it starts.
Deployment
1
Clone the repository
2
Configure environment variables
Copy the sample file and fill in the required values:
3
Start infrastructure services
Bring up NATS and Redis before the application services:Verify they are healthy:
4
Run the seed service
The The container exits on completion. Check for errors before proceeding:The seed service mounts
seed service applies Prisma migrations and loads master data (org roles, agent types, ledger configs, platform config):./libs/prisma-service/prisma/data/credebl-master-table.json into the container. Ensure this file is present in your checkout.5
Create the agent.env file
The Add the values your agent containers require, for example:
agent-provisioning service mounts ./agent.env into the container at /app/agent.env. This file is passed to each spawned agent container. Create it with at minimum the wallet storage credentials:agent.env
6
Start all platform services
7
Verify services are running
running status. The seed container will show exited 0 — that is expected.Confirm the API gateway is accepting requests:200 or 301 response confirms the gateway is up.8
Access the Swagger UI
Open your browser and navigate to:The interactive API documentation lists all available endpoints grouped by microservice.
Port reference
Volume mounts
Theagent-provisioning service requires the following mounts:
/var/run/docker.sock) is required so agent-provisioning can spin up per-organization agent containers on the host. The agent-service also mounts the Docker socket and uses volumes_from: agent-provisioning to access the shared agent-config and endpoints directories.
Troubleshooting
seed service fails with a database connection error
seed service fails with a database connection error
Confirm
DATABASE_URL in .env points to a reachable PostgreSQL instance. If PostgreSQL is running on the host machine, use the host’s LAN IP rather than localhost or 127.0.0.1, since services run inside Docker containers.api-gateway container exits immediately
api-gateway container exits immediately
Check logs with
docker compose logs api-gateway. Missing or malformed NKEY seed values are a common cause. Ensure all *_NKEY_SEED variables in .env are set.agent-service never starts
agent-service never starts
agent-service waits for the log line "Agent-Provisioning-Service Microservice is listening to NATS" from agent-provisioning. If agent-provisioning fails to connect to NATS, agent-service will wait indefinitely. Run docker compose logs agent-provisioning to diagnose.NATS authentication errors
NATS authentication errors
The
.env.sample sets NATS_AUTH_TYPE=nkey. Each service has its own *_NKEY_SEED variable. Generate unique NKey seeds for each service and set them in .env. The NATS_CREDS_FILE variable is only required when NATS_AUTH_TYPE=creds.agent containers are not being created
agent containers are not being created
Verify that
/var/run/docker.sock is mounted into agent-provisioning and that the user running Docker has permission to access the socket. Also confirm that AGENT_HOST and AFJ_VERSION are set in .env.