-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
151 lines (143 loc) · 4.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
151 lines (143 loc) · 4.12 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
services:
redis:
image: redis:7-alpine
container_name: sched-redis
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- sched-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
postgres:
image: postgres:16-alpine
container_name: sched-postgres
environment:
POSTGRES_DB: sched
POSTGRES_USER: sched
POSTGRES_PASSWORD: sched_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- sched-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sched"]
interval: 5s
timeout: 3s
retries: 5
# One-shot migration runner. Applies all pending migrations and exits.
# `make up` triggers it via depends_on; you can also run it directly:
# docker compose run --rm migrate
migrate:
image: migrate/migrate:v4.17.1
container_name: sched-migrate
depends_on:
postgres:
condition: service_healthy
volumes:
- ./migrations:/migrations:ro
networks:
- sched-network
command:
[
"-path", "/migrations",
"-database", "postgres://sched:sched_password@postgres:5432/sched?sslmode=disable",
"up",
]
restart: "no"
# Jaeger all-in-one. Optional. Enable with the `tracing` compose profile:
# docker compose --profile tracing up -d
# The engine, worker, and dashboard already export to SCHED_OTLP_ENDPOINT
# when set, so flipping this on lights up traces with no other changes.
jaeger:
image: jaegertracing/all-in-one:1.60
container_name: sched-jaeger
profiles: ["tracing"]
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC receiver
environment:
- COLLECTOR_OTLP_ENABLED=true
networks:
- sched-network
engine:
build:
context: .
dockerfile: Dockerfile.engine
container_name: sched-engine
# Engine drains in 8 seconds; default Docker grace (10s) is fine.
# Set explicitly so the value is documented next to the engine
# service and not implicit.
stop_grace_period: 15s
ports:
- "50051:50051"
- "9090:9090" # Prometheus /metrics
environment:
- ENGINE_PORT=50051
- SCHED_POSTGRES_DSN=postgres://sched:sched_password@postgres:5432/sched?sslmode=disable
- REDIS_ADDR=redis:6379
- SCHED_METRICS_PORT=9090
- SCHED_LOG_FORMAT=json
# When jaeger is running (compose profile=tracing), spans go here.
# Empty in the default profile so InitTracing installs the noop tracer.
- SCHED_OTLP_ENDPOINT=${SCHED_OTLP_ENDPOINT:-}
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
networks:
- sched-network
restart: unless-stopped
dashboard:
build:
context: .
dockerfile: Dockerfile.dashboard
container_name: sched-dashboard
ports:
- "8080:8080"
environment:
- ENGINE_ADDRESS=engine:50051
- DASHBOARD_PORT=8080
- SCHED_OTLP_ENDPOINT=${SCHED_OTLP_ENDPOINT:-}
depends_on:
- engine
networks:
- sched-network
restart: unless-stopped
worker:
build:
context: .
dockerfile: Dockerfile.worker
# No container_name so the service can be scaled with
# `docker compose up --scale worker=N`.
environment:
- ENGINE_ADDRESS=engine:50051
- TASK_QUEUE=default
- SCHED_OTLP_ENDPOINT=${SCHED_OTLP_ENDPOINT:-}
# Set SCHED_WORKER_STREAMING=true to use the Phase 5.8 bidi
# stream for workflow task dispatch instead of long-polling.
- SCHED_WORKER_STREAMING=${SCHED_WORKER_STREAMING:-false}
# Uncomment for demo mode (auto-starts test workflows):
# - AUTO_START_TEST=true
depends_on:
- engine
networks:
- sched-network
restart: unless-stopped
# Scale workers with: docker-compose up --scale worker=3
networks:
sched-network:
driver: bridge
volumes:
redis_data:
postgres_data: