Skip to main content

Deployment

The Kulpay API is designed for containerized deployment using Docker and Kubernetes.

Docker Deployment

The system uses a multi-stage Docker build to produce a minimal production image.

Docker Compose

The development stack includes:

ServiceImagePorts
Kulpay APICustom build8080 (REST), 50051 (gRPC)
PostgreSQLpostgres:155432

Environment Configuration

The Kulpay API supports environment-based configuration with the following hierarchy:

  1. config/config.yaml - Base configuration
  2. config/config.development.yaml - Development overrides
  3. config/config.production.yaml - Production overrides
  4. Environment variables - Runtime overrides (format: ${VAR:-default})

Key configuration sections:

SectionParameters
ServergRPC port, HTTP port, TLS certificates
DatabaseDialect, host, port, credentials, pool settings
CacheRedis host, port, database number
CORSAllowed origins, methods, headers
AuthenticationAPI keys, JWT settings, OIDC provider
WebhooksEndpoint URLs, retry configuration

Kubernetes Deployment

Production deployment uses Kustomize for Kubernetes configuration management.

Available CLI Tools

CommandPurpose
kulofficeStart the main API server
kuloffice-migrateRun database migrations
kuloffice-licenseManage license keys
kuloffice-bootstrapBootstrap initial system configuration

Database Migrations

Migrations are handled automatically by GORM's AutoMigrate feature. To run migrations explicitly:

kuloffice-migrate up

Technical Decision: GORM's AutoMigrate was chosen over manual migration scripts (e.g., golang-migrate) because the schema is still evolving rapidly. Auto-migration reduces the overhead of writing and maintaining migration files during the early stages. For production environments where schema changes need to be reviewed and versioned, the kuloffice-migrate CLI tool provides explicit control.

Health Checks

The system exposes health information through:

  • GET /v1/system/config/supported-docs - System configuration endpoint
  • GET /v1/version - Version information including build date and git commit