Running And Docker
Local Commands
Section titled “Local Commands”Run the API in watch mode:
pnpm dev:apiBuild the API:
pnpm build:apiPreview the built API:
pnpm preview:apiStart the built API:
pnpm start:apiRequired Services
Section titled “Required Services”The API expects:
- PostgreSQL
- Redis
For local development:
docker compose up -d db redisDocker Image
Section titled “Docker Image”Run the API container against the Compose PostgreSQL and Redis services:
docker compose up -d db redisDOCKER_NETWORK=dpg_internal pnpm docker:apiThe docker:api script builds dpg-api:local, normalizes quoted values from
.env for Docker, and runs the API container on the dpg_internal network.
You can still build the image directly with docker build -f apps/api/Dockerfile -t dpg-api:local . when needed.
The Dockerfile:
- uses Node 24 Alpine
- prunes the monorepo with Turbo for the
apiapp - installs dependencies with pnpm
- builds only
apps/api - installs production dependencies for the final image
- starts
node apps/api/dist/server.js
The container listens on 0.0.0.0:${API_PORT}. API_PORT defaults to 2742 in the image.
Core Runtime Env
Section titled “Core Runtime Env”| Variable | Purpose |
|---|---|
INSTANCE_NAME | Service name returned by health endpoint and used by auth |
INSTANCE_ENV | development or production |
API_DOMAIN | Public API base domain |
API_PORT | API listen port |
AUTH_SECRET | Better Auth secret |
SERVED_DOMAINS | Comma-separated network/domain bindings |
NETWORK_CONFIG_SOURCE | local or remote |
NETWORK_CONFIG_LOCAL_FILE | Local network config path |
NETWORK_CONFIG_URLS | Remote network=url mappings |
SCHEMA_REGISTRY_URL | Registry base URL or explicit mappings |
POSTGRES_URL | Full Postgres URL |
REDIS_URL | Full Redis URL |
Use full POSTGRES_URL and REDIS_URL in container deployments when possible.