Skip to main content

Run Modes Overview

Sercha Core supports three run modes, enabling flexible deployment from single-container development to distributed production clusters.

Mode Comparison

ModeHTTP ServerTask QueueSchedulerUse Case
allYesYesYesDevelopment, simple deployments
apiYesNoNoHorizontally scaled API tier
workerNoYesYesDedicated background processing

Configuration

Set the run mode via the RUN_MODE environment variable:

services:
sercha-api:
image: sercha-core:latest
environment:
RUN_MODE: api
# ... other config
ValueDescription
allCombined mode (default)
apiHTTP server only
workerBackground processing only

Architecture

Shared Infrastructure

All containers connect to the same backing services:

ServicePurposeRequired
PostgreSQLUser data, documents, metadataYes
VespaSearch indexYes
RedisSessions, queue, distributed locksNo (falls back to PostgreSQL)

Graceful Shutdown

All modes respond to container stop signals:

  1. Container runtime sends SIGTERM
  2. In-flight requests complete (API) or current task finishes (Worker)
  3. Connections drain within 30 seconds
  4. Container exits cleanly

Next Steps