Catalyst / admin/Synapse-Cortex 14.8 GB / 57.8 GB 40.0 GB free
Help Sign in

admin / Synapse-Cortex

public

Self Hosted ITSM Tool with RBAC/Tenanting and MFA

Code Issues Pull requests Pipelines Packages Security Insights Wiki Settings
Synapse-Cortex / Synapse-Cortexv2 / docker-compose.yml 2472 B · main
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# A pinned project name so the Postgres data volume below always resolves to
# the SAME physical volume, regardless of the folder this file lives in or how
# `docker compose` is invoked (`-p`, a renamed/copied checkout, etc.). Without
# this, Compose derives the project name from the directory name and the volume
# identity moves with the folder - a rebuild from a renamed copy would silently
# mount a fresh, empty database and custom asset types (plus all other data)
# would appear to vanish.
name: synapse-cortex

services:
  db:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-cortex}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-cortex}
      POSTGRES_DB: ${POSTGRES_DB:-synapse_cortex}
    volumes:
      - cortex_pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-cortex} -d ${POSTGRES_DB:-synapse_cortex}"]
      interval: 5s
      timeout: 5s
      retries: 10

  web:
    build: .
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    environment:
      DATABASE_URL: postgresql+psycopg2://${POSTGRES_USER:-cortex}:${POSTGRES_PASSWORD:-cortex}@db:5432/${POSTGRES_DB:-synapse_cortex}
      SECRET_KEY: ${SECRET_KEY:-change-me-in-production}
      ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
      # "Execute Live on Client" always opens a real SSH connection (gated by a
      # human confirmation + a prior simulation). sudo is auto-detected per host
      # (root -> direct, non-root -> sudo); host keys are trusted on first
      # contact by default so a new host just connects.
      SSH_USE_SUDO: ${SSH_USE_SUDO:-true}
      SSH_AUTO_ADD_HOST_KEYS: ${SSH_AUTO_ADD_HOST_KEYS:-true}
      SSH_CONNECT_TIMEOUT: ${SSH_CONNECT_TIMEOUT:-10}
      SSH_COMMAND_TIMEOUT: ${SSH_COMMAND_TIMEOUT:-60}
      ALLOW_AUTO_APPROVE: ${ALLOW_AUTO_APPROVE:-false}
    ports:
      - "8000:8000"
    volumes:
      - ./app:/app/app
      - ./alembic:/app/alembic

volumes:
  # Explicit, stable volume name (not the Compose default of
  # "<project>_cortex_pgdata"). Pinning it here guarantees the database - and
  # therefore all custom asset types, tickets, users, etc. - survives image
  # rebuilds and `docker compose up --build`. Only an explicit `docker compose
  # down -v` / `docker volume rm synapse_cortex_pgdata` destroys it.
  cortex_pgdata:
    name: synapse_cortex_pgdata