Files
activity-core/docker-compose.dev.yml
tegwick ea5fbe0bf3 feat(WP-0002): complete Triggers & Ops workstream
Delivers all 12 tasks (T22–T33): Temporal Schedule manager + startup
sync, NATS JetStream event router, FastAPI CRUD + manual trigger,
Prometheus metrics wiring, custom search-attribute tagging, and
operational runbook. Marks workplan status as done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 01:04:43 +01:00

172 lines
5.5 KiB
YAML

# activity-core — dev environment
#
# Temporal cluster (server + UI + admin-tools) backed by PostgreSQL + Elasticsearch,
# plus a separate app-db Postgres for activity-core application data.
#
# Endpoints:
# Temporal gRPC: localhost:7233
# Temporal Web UI: http://localhost:8080
# App DB Postgres: localhost:5433 (user: actcore / pass: actcore / db: actcore)
#
# Usage:
# docker compose -f docker-compose.dev.yml up -d
# docker compose -f docker-compose.dev.yml down -v # wipe volumes
version: "3.9"
services:
# ── Temporal persistence store ────────────────────────────────────────────────
temporal-db:
container_name: temporal-db
image: docker.io/postgres:16.6
environment:
POSTGRES_USER: temporal
POSTGRES_PASSWORD: temporal
POSTGRES_DB: temporal
networks:
- activity-net
expose:
- "5432"
volumes:
- temporal-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U temporal"]
interval: 5s
timeout: 5s
retries: 10
# ── Elasticsearch (Temporal visibility store) ─────────────────────────────────
elasticsearch:
container_name: temporal-elasticsearch
image: docker.io/elasticsearch:7.17.27
environment:
- cluster.routing.allocation.disk.threshold_enabled=true
- cluster.routing.allocation.disk.watermark.low=512mb
- cluster.routing.allocation.disk.watermark.high=256mb
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m
- xpack.security.enabled=false
networks:
- activity-net
expose:
- "9200"
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\\|yellow\"'"]
interval: 10s
timeout: 10s
retries: 10
# ── Temporal server ───────────────────────────────────────────────────────────
temporal:
container_name: temporal
image: docker.io/temporalio/auto-setup:1.29.1
depends_on:
temporal-db:
condition: service_healthy
elasticsearch:
condition: service_healthy
environment:
DB: postgres12
DB_PORT: 5432
POSTGRES_USER: temporal
POSTGRES_PWD: temporal
POSTGRES_SEEDS: temporal-db
DYNAMIC_CONFIG_FILE_PATH: config/dynamicconfig/development-sql.yaml
ENABLE_ES: "true"
ES_SEEDS: elasticsearch
ES_VERSION: v7
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_CLI_ADDRESS: temporal:7233
networks:
- activity-net
ports:
- "7233:7233"
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
healthcheck:
test: ["CMD", "temporal", "operator", "cluster", "health", "--address", "temporal:7233"]
interval: 10s
timeout: 10s
retries: 15
start_period: 30s
# ── Temporal Web UI ───────────────────────────────────────────────────────────
temporal-ui:
container_name: temporal-ui
image: docker.io/temporalio/ui:2.34.0
depends_on:
temporal:
condition: service_healthy
environment:
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_CORS_ORIGINS: http://localhost:3000
networks:
- activity-net
ports:
- "8080:8080"
# ── Temporal admin tools (shell access for debugging) ─────────────────────────
temporal-admin-tools:
container_name: temporal-admin-tools
image: docker.io/temporalio/admin-tools:1.29.1-tctl-1.18.4-cli-1.5.0
depends_on:
temporal:
condition: service_healthy
environment:
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_CLI_ADDRESS: temporal:7233
networks:
- activity-net
stdin_open: true
tty: true
# ── NATS JetStream (event broker for EventRouter) ────────────────────────────
nats:
container_name: actcore-nats
image: docker.io/nats:2.10-alpine
command: ["-js", "-m", "8222"]
networks:
- activity-net
ports:
- "4222:4222" # client connections
- "8222:8222" # monitoring / HTTP
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8222/healthz || exit 1"]
interval: 5s
timeout: 5s
retries: 10
# ── App database (activity-core application data) ─────────────────────────────
app-db:
container_name: actcore-app-db
image: docker.io/postgres:16.6
environment:
POSTGRES_USER: actcore
POSTGRES_PASSWORD: actcore
POSTGRES_DB: actcore
networks:
- activity-net
ports:
- "5433:5432" # exposed on 5433 to avoid clashing with temporal-db
volumes:
- app-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U actcore"]
interval: 5s
timeout: 5s
retries: 10
networks:
activity-net:
driver: bridge
name: activity-net
volumes:
temporal-db-data:
elasticsearch-data:
app-db-data: