-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathdocker-compose.extras.yml
More file actions
162 lines (152 loc) · 5.69 KB
/
Copy pathdocker-compose.extras.yml
File metadata and controls
162 lines (152 loc) · 5.69 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
152
153
154
155
156
157
158
159
160
161
162
# Optional services for advanced local-dev workflows. Pair with
# `docker-compose.yml` via `pnpm run docker:full`.
#
# Same `name:` so `docker compose` treats both files as one project — bring
# them up together and they share the `app_network` and `triggerdotdev-docker`
# volume namespace. Tear down with `pnpm run docker:full:stop`.
#
# Includes:
# - electric-shard-1: second Electric instance for multi-shard testing
# - ch-ui: ClickHouse browser UI
# - toxiproxy: chaos / flake testing
# - nginx-h2: HTTP/2 reverse proxy
# - otel-collector + prometheus + grafana: observability stack
name: triggerdotdev-docker
volumes:
redis-cluster-data:
prometheus-data:
grafana-data:
networks:
app_network:
external: false
services:
electric-shard-1:
container_name: ${CONTAINER_PREFIX:-}electric-shard-1
image: electricsql/electric:1.2.4@sha256:20da3d0b0e74926c5623392db67fd56698b9e374c4aeb6cb5cadeb8fea171c36
restart: always
environment:
DATABASE_URL: postgresql://postgres:postgres@database:5432/postgres?sslmode=disable
ELECTRIC_INSECURE: true
ELECTRIC_REPLICATION_STREAM_ID: "triggershard1"
networks:
- app_network
ports:
- "${ELECTRIC_SHARD_1_HOST_PORT:-3061}:3000"
depends_on:
- database
ch-ui:
image: ghcr.io/caioricciuti/ch-ui:latest@sha256:288abf7103d6e0f45527ee835ee79bd1e0bfb82d55dc514fb3cf43816306b538
restart: always
ports:
- "${CH_UI_HOST_PORT:-5521}:5521"
environment:
VITE_CLICKHOUSE_URL: "http://localhost:${CLICKHOUSE_HTTP_HOST_PORT:-8123}"
VITE_CLICKHOUSE_USER: "default"
VITE_CLICKHOUSE_PASS: "password"
networks:
- app_network
toxiproxy:
container_name: ${CONTAINER_PREFIX:-}toxiproxy
image: ghcr.io/shopify/toxiproxy:latest@sha256:9378ed52a28bc50edc1350f936f518f31fa95f0d15917d6eb40b8e376d1a214e
restart: always
volumes:
- ./config/toxiproxy.json:/config/toxiproxy.json
ports:
- "${TOXIPROXY_PROXY_HOST_PORT:-30303}:30303" # Proxied webapp port
- "${TOXIPROXY_API_HOST_PORT:-8474}:8474" # Toxiproxy API port
networks:
- app_network
command: ["-host", "0.0.0.0", "-config", "/config/toxiproxy.json"]
nginx-h2:
image: nginx:1.27@sha256:6784fb0834aa7dbbe12e3d7471e69c290df3e6ba810dc38b34ae33d3c1c05f7d
container_name: ${CONTAINER_PREFIX:-}nginx-h2
restart: unless-stopped
ports:
- "${NGINX_H2_HOST_PORT:-8443}:8443"
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
- ./config/certs:/etc/nginx/certs:ro
networks:
- app_network
# Observability stack for local development
otel-collector:
container_name: ${CONTAINER_PREFIX:-}otel-collector
image: otel/opentelemetry-collector-contrib:0.96.0@sha256:7ef2a2ff46b9e432321fdd63df104bfeedaf7b4e276950f42c634d0f23521fc4
restart: always
command: ["--config", "/etc/otel-collector-config.yaml"]
volumes:
- ./config/otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
ports:
- "${OTEL_GRPC_HOST_PORT:-4317}:4317" # OTLP gRPC receiver
- "${OTEL_HTTP_HOST_PORT:-4318}:4318" # OTLP HTTP receiver
- "${OTEL_PROMETHEUS_HOST_PORT:-8889}:8889" # Prometheus exporter
networks:
- app_network
prometheus:
container_name: ${CONTAINER_PREFIX:-}prometheus
image: prom/prometheus:v2.54.1@sha256:f6639335d34a77d9d9db382b92eeb7fc00934be8eae81dbc03b31cfe90411a94
restart: always
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./config/alerts:/etc/prometheus/alerts:ro
- prometheus-data:/prometheus
ports:
- "${PROMETHEUS_HOST_PORT:-9090}:9090"
networks:
- app_network
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.enable-lifecycle"
grafana:
container_name: ${CONTAINER_PREFIX:-}grafana
image: grafana/grafana:11.3.0@sha256:a0f881232a6fb71a0554a47d0fe2203b6888fe77f4cefb7ea62bed7eb54e13c3
restart: always
volumes:
- grafana-data:/var/lib/grafana
- ./config/grafana/provisioning:/etc/grafana/provisioning:ro
ports:
- "${GRAFANA_HOST_PORT:-4001}:3000"
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_USERS_ALLOW_SIGN_UP: false
networks:
- app_network
depends_on:
- prometheus
# Six-node Redis cluster (3 masters, 3 replicas) for validating the execution-snapshot store.
# The store's single-slot guarantee only means anything against a cluster-mode endpoint, and the
# recovery worker's per-master fan-out is unreachable on a single node.
#
# RUN_ENGINE_SNAPSHOT_STORE_REDIS_HOST=127.0.0.1
# RUN_ENGINE_SNAPSHOT_STORE_REDIS_PORT=7001
# RUN_ENGINE_SNAPSHOT_STORE_REDIS_CLUSTER_MODE_ENABLED=1
#
# ioredis discovers the other five nodes from that one seed.
redis-cluster:
container_name: ${CONTAINER_PREFIX:-}redis-cluster
image: redis:7.2@sha256:74566c6910d13ae61e7ce73ebd3127438a1fe805b309b097c323142719ec8a5b
restart: always
volumes:
- ./config/redis-cluster-init.sh:/init.sh:ro
- redis-cluster-data:/data
command: sh /init.sh
ports:
- "${REDIS_CLUSTER_PORT_1:-7001}:7001"
- "${REDIS_CLUSTER_PORT_2:-7002}:7002"
- "${REDIS_CLUSTER_PORT_3:-7003}:7003"
- "${REDIS_CLUSTER_PORT_4:-7004}:7004"
- "${REDIS_CLUSTER_PORT_5:-7005}:7005"
- "${REDIS_CLUSTER_PORT_6:-7006}:7006"
- "17001:17001"
- "17002:17002"
- "17003:17003"
- "17004:17004"
- "17005:17005"
- "17006:17006"
healthcheck:
test: ["CMD-SHELL", "redis-cli -p 7001 cluster info | grep -q cluster_state:ok"]
interval: 5s
timeout: 3s
retries: 20

