Files
Primora/docker-compose.yml
T
Tomas DvorakandDevin 9e9a3d5f98 feat: phase 7 automation & realtime — scheduled jobs, domain events, SSE
Scheduled jobs (migration 00009): cron expressions + @every descriptors,
in-process scheduler (15s scan, missed-run collapse), signed HTTP POST
delivery (X-Primora-Signature), AES-256-GCM sealed secrets returned once,
run history with status/duration/http-code, manual execution, retention
pruning. Viewer reads, admin/developer writes.

Domain events: publishEvent fans document/object/issue/deploy/job
mutations to realtime subscribers and matching webhooks through one
path. Webhook event filter extended to job.run, document.*, object.*.

Realtime: GET /projects/:id/realtime/stream SSE with 25s keepalives and
?token=/?api_key= auth for EventSource clients.

Automation dashboard page: Schedules tab (CRUD, run history, manual run,
secret-once banner) + Live events tab (live badge, pause/clear). Demo
mode parity. primora jobs:* CLI group, six primora_*_job* MCP tools,
AutomationService in the generated client.

Fixes folded in: gzip middleware buffered SSE flushes (broke EventSource
on both streams — */stream now bypasses compression); event payloads
double-marshaled json.RawMessage as base64; compose hardcoded localhost
trusted origins so non-default ports broke sign-in; frontend auth base
URL baked an absolute localhost instead of resolving /auth on origin.

Verified live: stack up on :8085, signed delivery HMAC-checked at sink,
@every 30s schedule firing, run history rendering, document.created
landing in the live events feed.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-18 15:15:01 +02:00

129 lines
3.5 KiB
YAML

services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 20
restart: unless-stopped
dragonfly:
image: docker.dragonflydb.io/dragonflydb/dragonfly:v2.0.0
command: ["--logtostderr", "--proactor_threads=4"]
ports:
- "${DRAGONFLY_PORT:-6379}:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli -p 6379 ping | grep -q PONG"]
interval: 10s
timeout: 3s
retries: 10
restart: unless-stopped
backend:
build:
context: .
dockerfile: apps/backend/Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable
DRAGONFLY_URL: redis://dragonfly:6379/0
BACKEND_STORAGE_ROOT: /data/storage
BACKEND_MIGRATIONS_DIR: /app/db/migrations
VITE_APP_URL: ${VITE_APP_URL}
depends_on:
postgres:
condition: service_healthy
dragonfly:
condition: service_started
volumes:
- backend_storage:/data/storage
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/api/v1/health/liveness || exit 1"]
interval: 15s
timeout: 5s
retries: 10
start_period: 20s
restart: unless-stopped
auth:
build:
context: .
dockerfile: apps/auth/Dockerfile
env_file:
- .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable
DRAGONFLY_URL: redis://dragonfly:6379/0
BETTER_AUTH_URL: ${BETTER_AUTH_URL:-http://localhost/auth}
AUTH_BASE_URL: ${AUTH_BASE_URL:-http://localhost/auth}
VITE_APP_URL: ${VITE_APP_URL:-http://localhost}
depends_on:
postgres:
condition: service_healthy
dragonfly:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3001/health >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 10
start_period: 20s
restart: unless-stopped
frontend:
build:
context: .
dockerfile: apps/frontend/Dockerfile
env_file:
- .env
environment:
VITE_APP_URL: http://localhost
VITE_AUTH_BASE_URL: http://localhost/auth
VITE_API_BASE_URL: http://localhost/api/v1
FRONTEND_PORT: 3000
depends_on:
backend:
condition: service_started
auth:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost/ >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 10
restart: unless-stopped
nginx:
image: nginx:1.27-alpine
depends_on:
backend:
condition: service_started
auth:
condition: service_started
frontend:
condition: service_started
ports:
- "${NGINX_PORT}:80"
volumes:
- ./infra/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost/nginx-health >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 10
restart: unless-stopped
volumes:
postgres_data:
backend_storage: