|
| 1 | +# Optional services for advanced local-dev workflows. Pair with |
| 2 | +# `docker-compose.yml` via `pnpm run docker:full`. |
| 3 | +# |
| 4 | +# Same `name:` so `docker compose` treats both files as one project — bring |
| 5 | +# them up together and they share the `app_network` and `triggerdotdev-docker` |
| 6 | +# volume namespace. Tear down with `pnpm run docker:full:stop`. |
| 7 | +# |
| 8 | +# Includes: |
| 9 | +# - electric-shard-1: second Electric instance for multi-shard testing |
| 10 | +# - ch-ui: ClickHouse browser UI |
| 11 | +# - toxiproxy: chaos / flake testing |
| 12 | +# - nginx-h2: HTTP/2 reverse proxy |
| 13 | +# - otel-collector + prometheus + grafana: observability stack |
| 14 | +name: triggerdotdev-docker |
| 15 | + |
| 16 | +volumes: |
| 17 | + prometheus-data: |
| 18 | + grafana-data: |
| 19 | + |
| 20 | +networks: |
| 21 | + app_network: |
| 22 | + external: false |
| 23 | + |
| 24 | +services: |
| 25 | + electric-shard-1: |
| 26 | + container_name: ${CONTAINER_PREFIX:-}electric-shard-1 |
| 27 | + image: electricsql/electric:1.2.4@sha256:20da3d0b0e74926c5623392db67fd56698b9e374c4aeb6cb5cadeb8fea171c36 |
| 28 | + restart: always |
| 29 | + environment: |
| 30 | + DATABASE_URL: postgresql://postgres:postgres@database:5432/postgres?sslmode=disable |
| 31 | + ELECTRIC_INSECURE: true |
| 32 | + ELECTRIC_REPLICATION_STREAM_ID: "triggershard1" |
| 33 | + networks: |
| 34 | + - app_network |
| 35 | + ports: |
| 36 | + - "${ELECTRIC_SHARD_1_HOST_PORT:-3061}:3000" |
| 37 | + depends_on: |
| 38 | + - database |
| 39 | + |
| 40 | + ch-ui: |
| 41 | + image: ghcr.io/caioricciuti/ch-ui:latest |
| 42 | + restart: always |
| 43 | + ports: |
| 44 | + - "${CH_UI_HOST_PORT:-5521}:5521" |
| 45 | + environment: |
| 46 | + VITE_CLICKHOUSE_URL: "http://localhost:${CLICKHOUSE_HTTP_HOST_PORT:-8123}" |
| 47 | + VITE_CLICKHOUSE_USER: "default" |
| 48 | + VITE_CLICKHOUSE_PASS: "password" |
| 49 | + networks: |
| 50 | + - app_network |
| 51 | + |
| 52 | + toxiproxy: |
| 53 | + container_name: ${CONTAINER_PREFIX:-}toxiproxy |
| 54 | + image: ghcr.io/shopify/toxiproxy:latest |
| 55 | + restart: always |
| 56 | + volumes: |
| 57 | + - ./config/toxiproxy.json:/config/toxiproxy.json |
| 58 | + ports: |
| 59 | + - "${TOXIPROXY_PROXY_HOST_PORT:-30303}:30303" # Proxied webapp port |
| 60 | + - "${TOXIPROXY_API_HOST_PORT:-8474}:8474" # Toxiproxy API port |
| 61 | + networks: |
| 62 | + - app_network |
| 63 | + command: ["-host", "0.0.0.0", "-config", "/config/toxiproxy.json"] |
| 64 | + |
| 65 | + nginx-h2: |
| 66 | + image: nginx:1.27 |
| 67 | + container_name: ${CONTAINER_PREFIX:-}nginx-h2 |
| 68 | + restart: unless-stopped |
| 69 | + ports: |
| 70 | + - "${NGINX_H2_HOST_PORT:-8443}:8443" |
| 71 | + volumes: |
| 72 | + - ./config/nginx.conf:/etc/nginx/nginx.conf:ro |
| 73 | + - ./config/certs:/etc/nginx/certs:ro |
| 74 | + |
| 75 | + # Observability stack for local development |
| 76 | + otel-collector: |
| 77 | + container_name: ${CONTAINER_PREFIX:-}otel-collector |
| 78 | + image: otel/opentelemetry-collector-contrib:0.96.0 |
| 79 | + restart: always |
| 80 | + command: ["--config", "/etc/otel-collector-config.yaml"] |
| 81 | + volumes: |
| 82 | + - ./config/otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro |
| 83 | + ports: |
| 84 | + - "${OTEL_GRPC_HOST_PORT:-4317}:4317" # OTLP gRPC receiver |
| 85 | + - "${OTEL_HTTP_HOST_PORT:-4318}:4318" # OTLP HTTP receiver |
| 86 | + - "${OTEL_PROMETHEUS_HOST_PORT:-8889}:8889" # Prometheus exporter |
| 87 | + networks: |
| 88 | + - app_network |
| 89 | + |
| 90 | + prometheus: |
| 91 | + container_name: ${CONTAINER_PREFIX:-}prometheus |
| 92 | + image: prom/prometheus:v2.54.1 |
| 93 | + restart: always |
| 94 | + volumes: |
| 95 | + - ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro |
| 96 | + - prometheus-data:/prometheus |
| 97 | + ports: |
| 98 | + - "${PROMETHEUS_HOST_PORT:-9090}:9090" |
| 99 | + networks: |
| 100 | + - app_network |
| 101 | + command: |
| 102 | + - "--config.file=/etc/prometheus/prometheus.yml" |
| 103 | + - "--storage.tsdb.path=/prometheus" |
| 104 | + - "--web.enable-lifecycle" |
| 105 | + |
| 106 | + grafana: |
| 107 | + container_name: ${CONTAINER_PREFIX:-}grafana |
| 108 | + image: grafana/grafana:11.3.0 |
| 109 | + restart: always |
| 110 | + volumes: |
| 111 | + - grafana-data:/var/lib/grafana |
| 112 | + - ./config/grafana/provisioning:/etc/grafana/provisioning:ro |
| 113 | + ports: |
| 114 | + - "${GRAFANA_HOST_PORT:-3001}:3000" |
| 115 | + environment: |
| 116 | + GF_SECURITY_ADMIN_USER: admin |
| 117 | + GF_SECURITY_ADMIN_PASSWORD: admin |
| 118 | + GF_USERS_ALLOW_SIGN_UP: false |
| 119 | + networks: |
| 120 | + - app_network |
| 121 | + depends_on: |
| 122 | + - prometheus |
0 commit comments