Skip to main content

Deployment: open-bot-framework

Infrastructure config for this service. Full platform deployment: docs/architecture/deployment.md

Runtime

  • HTTP Port: 1986 (env: PORT, default 1986)
  • WebSocket Port: 1992 (env: SOCKET_PORT, default 1992)
  • Base image: node:22 (build stage), node:22-slim (runtime stage) — multi-stage Dockerfile
  • Start command: node dist/src/main (production) / nest start --watch (dev)
  • Health check: none defined

Required Environment Variables

VariableExampleDescription
PORT1986HTTP listen port
SOCKET_PORT1992WebSocket server port
DIRECTLINE_HOSTlocalhost.homeHostname used in DirectLine stream URLs
DIRECTLINE_REGIONeuRegion tag
DIRECTLINE_SOCKET_URLwss://localhost:1992WebSocket base URL returned to clients
JWT_SECRET(secret)JWT signing secret for DirectLine tokens
JWT_EXPIRATION_SECONDS3600DirectLine token lifetime in seconds
TYPEORM_CONNECTIONpostgresDB driver (postgres)
TYPEORM_HOSTlocalhostPostgreSQL host
TYPEORM_PORT5432PostgreSQL port
TYPEORM_USERNAMEpostgresPostgreSQL user
TYPEORM_PASSWORD(secret)PostgreSQL password
TYPEORM_DATABASEobfPostgreSQL database name
TYPEORM_ENTITIESdist/**/*.entity.jsTypeORM entity glob
TYPEORM_MIGRATIONSdist/migrations/*.jsTypeORM migrations glob
TYPEORM_MIGRATIONS_DIRmigrationsMigrations source directory
TYPEORM_AUTORUN_MIGRATIONStrueRun migrations on startup
STORAGE_ACCESS_KEY(secret)S3-compatible access key
STORAGE_SECRET_KEY(secret)S3-compatible secret key
STORAGE_BUCKETS3 bucket name
STORAGE_REGION_S3us-east-1S3 region (AWS S3 only)
STORAGE_FORCE_S3_PATH_STYLEtrueForce path-style URLs (MinIO/custom endpoints)
STORAGE_ENDPOINTS3-compatible endpoint URL (leave unset for AWS)
REDIS_URIredis://localhost:6379Redis connection URI
ATOMIC_OPERATIONS_IMPLEMENTATIONredisCounter backend: redis or memory

Docker

Multi-stage Dockerfile: node:22 (build) and node:22-slim (runtime). Exposes ports 1986 (HTTP) and 1992 (WebSocket).

# Build Docker image
docker build -t open-bot-framework .

# Run (production)
node dist/src/main

# Run (dev, hot reload)
npm run start:dev

CI/CD

No CI/CD configuration is present in this repository (no .github/workflows/). Deployment is managed externally.

Notes

  • Two ports are required: HTTP (PORT) and WebSocket (SOCKET_PORT). Both must be accessible to clients.
  • PostgreSQL is the only supported database (TYPEORM_CONNECTION=postgres). Schema sync is handled via TypeORM migrations run automatically on startup.
  • Redis is optional: if ATOMIC_OPERATIONS_IMPLEMENTATION=memory (or Redis is unreachable), the service falls back to an in-memory atomic counter. This is not safe for multi-instance deployments.
  • S3 storage is used for conversation attachment uploads. All three of STORAGE_ACCESS_KEY, STORAGE_SECRET_KEY, and STORAGE_BUCKET must be set for uploads to work. STORAGE_ENDPOINT is only needed for non-AWS S3-compatible services (MinIO, Wasabi, DigitalOcean Spaces).
  • ormconfig.ts loads .env.local (not .env) for migration CLI commands. Set up a local .env.local for running migrations manually.