Skip to content

Docker

Run the gateway with Docker Compose, with Postgres, object storage and a local model.

Applies to Engine
View as Markdown
compose.yaml
services:
  ai:
    image: ghcr.io/sespinosav/sypnia-ai:1
    ports: ["8095:8095"]
    environment:
      SYPNIA_GATEWAY_DATABASE_URL: postgres://sypnia:${DB_PASSWORD}@db:5432/sypnia_ai
      SYPNIA_GATEWAY_ROOT_TOKEN: ${SYPNIA_GATEWAY_ROOT_TOKEN}
      SYPNIA_GATEWAY_OPENROUTER_KEY: ${OPENROUTER_API_KEY}
      SYPNIA_GATEWAY_PROVIDERS: local=http://models:11434/v1
      SYPNIA_GATEWAY_STORAGE_URL: s3://sypnia-ai?endpoint=http://storage:9000
      SYPNIA_GATEWAY_OTLP_ENDPOINT: https://telemetry.ingest.sypnia.com/v1/otlp
      SYPNIA_GATEWAY_OTLP_HEADERS: Authorization=Bearer ${SYPNIA_PROJECT_KEY}
    depends_on: [db, storage]
  db:
    image: postgres:16
    environment: { POSTGRES_USER: sypnia, POSTGRES_PASSWORD: "${DB_PASSWORD}", POSTGRES_DB: sypnia_ai }
    volumes: [db:/var/lib/postgresql/data]
  storage:
    image: minio/minio
    command: server /data
    volumes: [storage:/data]
volumes: { db: {}, storage: {} }
  • Object storage is optional. Without it, routes cannot keep questions and answers, and the response cache stays off.
  • A local model is any server that speaks the OpenAI API; in routes it is local/<model name>.
  • Health is GET /v1/health; metrics for Prometheus are at GET /metrics, with the root token.
  • Size. The gateway needs about 256 MB of memory for hundreds of answers streaming at once; most of a call’s time is the model’s.

Run migrations on start with SYPNIA_GATEWAY_AUTO_MIGRATE=true, or once with docker compose run ai sypnia-ai migrate.

    Search pages, sections and terms