Post-Deploy Bootstrap
Run the required seeds after deployment, and use the reset workflow only when you intentionally want to wipe and reseed an environment.
Last updated
This page covers two different workflows:
- fresh bootstrap on a healthy, migrated stack
- full reset and reseed of an existing environment
Do not treat them as interchangeable. Fresh bootstrap is normal. Full reset is destructive.
Before you run anything
Make sure:
- the stack is already up and healthy
- the
migrateservice has completed successfully - you know which deployment path you are using
Important runtime notes:
docker-compose.source.ymlanddocker-compose.registry.ymlsupport both Infisical-backed startup andSKIP_INFISICAL=trueraw-env startupdocker-compose.dokploy.ymlis intentionally Infisical-backed- the
toolsprofile is opt-in in every compose variant, so build thetoolsimage before trying to run seeds through Compose
Example:
docker compose -f docker-compose.source.yml --profile tools build toolsRequired order
Run these in this order:
seed:system-adminseed:isoseed:sectorsseed:demo-tenantif you want demo data
Why this order matters:
- the system admin gives you the first privileged login
- ISO data provides foundational countries, currencies, and languages
- sectors depend on the broader reference-data foundation
- demo tenant data is optional and assumes the baseline data is already available
Fresh bootstrap
Use this flow after a clean deploy when the schema already exists and you only need to load baseline data.
Direct workspace commands
Use these when you are running the app from a local checkout or a manual runtime such as PM2.
System administrator
SYSTEM_ADMIN_PASSWORD="YourStrongPasswordHere" pnpm seed:system-adminWhat it does:
- ensures the
SYSTEM_ADMINrole exists - creates the system admin user if missing
- wires the user into the auth model
The current script has a built-in default password, but you should always provide SYSTEM_ADMIN_PASSWORD explicitly so you do not accidentally seed a predictable credential.
ISO reference data
pnpm seed:isoWhat it seeds:
- nations
- currencies
- languages
Sector reference data
pnpm seed:sectorsOptional country-specific run:
pnpm seed:sectors -- --country=KE
pnpm seed:sectors -- --country=KE,NGDemo tenant
pnpm seed:demo-tenant \
--company-name="Acme Microfinance" \
--head-office-country=KE \
--base-currency=KES \
--shared-password="Secret123!@#" \
--timezone=Africa/NairobiThis is optional and intended for demo or sandbox-style environments.
Required arguments:
--company-name--head-office-country--base-currency--shared-password
Optional arguments:
--timezone--license-expiry-date
As an alternative to --shared-password, you can set DEMO_SHARED_PASSWORD in the process environment.
Docker Compose: source build or registry images
For docker-compose.source.yml and docker-compose.registry.yml, the bootstrap commands work in both supported modes:
- Infisical-backed startup
- raw-env startup with
SKIP_INFISICAL=true
If you are using raw envs, make sure your .env is fully populated. The tools container loads the same runtime config schema as the app services.
Example with docker-compose.source.yml:
docker compose -f docker-compose.source.yml --profile tools build tools
docker compose -f docker-compose.source.yml --profile tools run --rm \
-e SYSTEM_ADMIN_PASSWORD="YourStrongPasswordHere" \
tools pnpm seed:system-admin
docker compose -f docker-compose.source.yml --profile tools run --rm \
tools pnpm seed:iso
docker compose -f docker-compose.source.yml --profile tools run --rm \
tools pnpm seed:sectors
docker compose -f docker-compose.source.yml --profile tools run --rm \
tools pnpm seed:demo-tenant \
--company-name="Acme Microfinance" \
--head-office-country=KE \
--base-currency=KES \
--shared-password="Secret123!@#" \
--timezone=Africa/NairobiIf you are using the registry-images variant, replace docker-compose.source.yml with docker-compose.registry.yml.
Dokploy
For Dokploy, run bootstrap commands from the generated server-side checkout after the main stack is healthy.
Dokploy typically renders the selected compose file into a generated docker-compose.yml under its project directory. Use that generated file together with the Dokploy project name.
Example:
cd /etc/dokploy/compose/<dokploy-project>/code
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools build tools
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
-e SYSTEM_ADMIN_PASSWORD="YourStrongPasswordHere" \
tools pnpm seed:system-admin
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
tools pnpm seed:iso
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
tools pnpm seed:sectors
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
tools pnpm seed:demo-tenant \
--company-name="Acme Microfinance" \
--head-office-country=KE \
--base-currency=KES \
--shared-password="Secret123!@#" \
--timezone=Africa/NairobiFull reset and reseed
Destructive workflow
The reset flow drops the database schema, recreates it from migrations, clears Redis, and then reseeds the environment. Use it only when you explicitly intend to wipe the current environment.
Use this when you want a clean sandbox or you are rebuilding a non-production environment from scratch.
Docker Compose: source build or registry images
Example with docker-compose.source.yml:
docker compose -f docker-compose.source.yml --profile tools build tools
docker compose -f docker-compose.source.yml run --rm migrate \
pnpm prisma migrate reset --force
docker compose -f docker-compose.source.yml exec -T redis \
sh -lc 'redis-cli -a "$REDIS_PASSWORD" FLUSHALL'
docker compose -f docker-compose.source.yml --profile tools run --rm \
-e SYSTEM_ADMIN_PASSWORD="YourStrongPasswordHere" \
tools pnpm seed:system-admin
docker compose -f docker-compose.source.yml --profile tools run --rm \
tools pnpm seed:iso
docker compose -f docker-compose.source.yml --profile tools run --rm \
tools pnpm seed:sectors
docker compose -f docker-compose.source.yml --profile tools run --rm \
tools pnpm seed:demo-tenant \
--company-name="Acme Microfinance" \
--head-office-country=KE \
--base-currency=KES \
--shared-password="Secret123!@#" \
--timezone=Africa/NairobiIf you are using the registry-images variant, replace docker-compose.source.yml with docker-compose.registry.yml.
Dokploy
Example:
cd /etc/dokploy/compose/<dokploy-project>/code
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools build tools
sudo docker compose -p <dokploy-project> -f docker-compose.yml run --rm migrate \
pnpm prisma migrate reset --force
sudo docker compose -p <dokploy-project> -f docker-compose.yml exec -T redis \
sh -lc 'redis-cli -a "$REDIS_PASSWORD" FLUSHALL'
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
-e SYSTEM_ADMIN_PASSWORD="YourStrongPasswordHere" \
tools pnpm seed:system-admin
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
tools pnpm seed:iso
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
tools pnpm seed:sectors
sudo docker compose -p <dokploy-project> -f docker-compose.yml --profile tools run --rm \
tools pnpm seed:demo-tenant \
--company-name="Acme Microfinance" \
--head-office-country=NG \
--base-currency=NGN \
--shared-password="Pass@12345678?" \
--timezone=Africa/LagosUseful follow-up tool
To test email delivery or render email previews:
pnpm email:test -- --listWhat to verify after bootstrap
After the bootstrap flow:
- log in with the system admin
- confirm ISO data exists
- confirm sector data exists
- if demo data was loaded, confirm the seeded tenant is visible
- test one auth or email flow if email is enabled
Next step
If you want a workstation-oriented setup, see Local Development. Otherwise continue with Telemetry and Monitoring.