gitza-mcp/compose.yml

82 lines
2 KiB
YAML

x-runtime: &runtime
build: .
image: gitza-mcp:${MCP_IMAGE_TAG:-0.1.0}
read_only: true
tmpfs:
- /tmp:size=16m,mode=1777
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
x-database: &database
DATABASE_URL: postgres://mcp:${MCP_DB_PASSWORD:?set MCP_DB_PASSWORD}@postgres:5432/mcp
MCP_ENCRYPTION_KEYS: ${MCP_ENCRYPTION_KEYS:?set MCP_ENCRYPTION_KEYS}
services:
postgres:
build:
context: .
dockerfile: deploy/Dockerfile.postgres
image: gitza-mcp-postgres:18
restart: unless-stopped
environment:
POSTGRES_DB: mcp
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}
MCP_DB_PASSWORD: ${MCP_DB_PASSWORD:?set MCP_DB_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres -d mcp']
interval: 5s
timeout: 5s
retries: 30
networks:
- database
migrate:
<<: *runtime
command: ['migrate']
restart: 'no'
healthcheck:
disable: true
environment:
<<: *database
depends_on:
postgres:
condition: service_healthy
networks:
- database
mcp:
<<: *runtime
command: ['http']
restart: unless-stopped
init: true
stop_grace_period: 25s
environment:
<<: *database
GITZA_URL: ${GITZA_URL:-https://git.gitza.co.za}
MCP_ORIGIN: ${MCP_ORIGIN:?set MCP_ORIGIN}
GITZA_CLIENT_ID: ${GITZA_CLIENT_ID:?set GITZA_CLIENT_ID}
GITZA_CLIENT_SECRET: ${GITZA_CLIENT_SECRET:?set GITZA_CLIENT_SECRET}
MCP_COOKIE_KEYS: ${MCP_COOKIE_KEYS:?set MCP_COOKIE_KEYS}
MCP_SIGNING_JWKS: ${MCP_SIGNING_JWKS:?set MCP_SIGNING_JWKS}
MCP_TRUST_PROXY: ${MCP_TRUST_PROXY:-}
expose:
- '3400'
depends_on:
migrate:
condition: service_completed_successfully
networks:
- database
- default
networks:
database:
internal: true
default: {}
volumes:
postgres-data: