11# docker-compose.dev.yml — Development stack with ALL components enabled.
22# Usage: docker compose -f docker-compose.dev.yml up --build
33#
4- # Includes: API, Web (Nginx), Notification Worker, Export Worker,
5- # PostgreSQL, Redis, Mosquitto, Grafana, Jaeger (tracing).
4+ # Includes: API, Web (Nginx), Notification Worker, Export Worker, Automation Worker,
5+ # PostgreSQL, Redis, Mosquitto, Grafana, Tempo + Jaeger (tracing).
66# All tracing and telemetry features are enabled by default.
77#
88# ⚠️ TimescaleDB-HA migration (ADR-007):
@@ -51,7 +51,7 @@ services:
5151 - FLEET_TELEMETRY_FALLBACK_POLL_INTERVAL=5m
5252 # Tracing enabled by default in dev
5353 - OTEL_ENABLED=true
54- - OTEL_ENDPOINT=jaeger :4317
54+ - OTEL_ENDPOINT=otel-collector :4317
5555 - OTEL_SERVICE_NAME=teslasync-api
5656 - OTEL_INSECURE=true
5757 - GOOGLE_MAPS_API_KEY=${GOOGLE_MAPS_API_KEY:-}
@@ -63,7 +63,7 @@ services:
6363 condition : service_started
6464 redis :
6565 condition : service_healthy
66- jaeger :
66+ otel-collector :
6767 condition : service_started
6868 healthcheck :
6969 test : ["CMD", "/usr/local/bin/teslasync", "healthcheck"]
@@ -104,14 +104,16 @@ services:
104104 - LOG_LEVEL=error
105105 - HEALTH_PORT=8081
106106 - OTEL_ENABLED=true
107- - OTEL_ENDPOINT=jaeger :4317
107+ - OTEL_ENDPOINT=otel-collector :4317
108108 - OTEL_SERVICE_NAME=teslasync-notification-worker
109109 - OTEL_INSECURE=true
110110 depends_on :
111111 postgres :
112112 condition : service_healthy
113113 mosquitto :
114114 condition : service_started
115+ otel-collector :
116+ condition : service_started
115117 healthcheck :
116118 test : ["CMD", "/usr/local/bin/notification-worker", "healthcheck"]
117119 interval : 15s
@@ -139,21 +141,63 @@ services:
139141 - LOG_LEVEL=error
140142 - HEALTH_PORT=8082
141143 - OTEL_ENABLED=true
142- - OTEL_ENDPOINT=jaeger :4317
144+ - OTEL_ENDPOINT=otel-collector :4317
143145 - OTEL_SERVICE_NAME=teslasync-export-worker
144146 - OTEL_INSECURE=true
145147 depends_on :
146148 postgres :
147149 condition : service_healthy
148150 mosquitto :
149151 condition : service_started
152+ otel-collector :
153+ condition : service_started
150154 healthcheck :
151155 test : ["CMD", "/usr/local/bin/export-worker", "healthcheck"]
152156 interval : 15s
153157 timeout : 5s
154158 retries : 3
155159 start_period : 10s
156160
161+ automation-worker :
162+ build :
163+ context : .
164+ dockerfile : Dockerfile.automation
165+ args :
166+ VERSION : dev
167+ container_name : teslasync-automation-worker-dev
168+ restart : unless-stopped
169+ environment :
170+ - DATABASE_HOST=postgres
171+ - DATABASE_PORT=5432
172+ - DATABASE_USER=teslasync
173+ - DATABASE_PASSWORD=teslasync
174+ - DATABASE_NAME=teslasync
175+ - DATABASE_SSL_MODE=disable
176+ - MQTT_HOST=mosquitto
177+ - MQTT_PORT=1883
178+ - TESLA_CLIENT_ID=${TESLA_CLIENT_ID:-dev-client-id}
179+ - TESLA_CLIENT_SECRET=${TESLA_CLIENT_SECRET:-dev-client-secret}
180+ - TESLA_API_BASE_URL=${TESLA_API_BASE_URL:-https://fleet-api.prd.na.vn.cloud.tesla.com}
181+ - LOG_LEVEL=error
182+ - HEALTH_PORT=8083
183+ - OTEL_ENABLED=true
184+ - OTEL_ENDPOINT=otel-collector:4317
185+ - OTEL_SERVICE_NAME=teslasync-automation-worker
186+ - OTEL_INSECURE=true
187+ depends_on :
188+ postgres :
189+ condition : service_healthy
190+ mosquitto :
191+ condition : service_started
192+ otel-collector :
193+ condition : service_started
194+ healthcheck :
195+ test : ["CMD", "/usr/local/bin/automation-worker", "healthcheck"]
196+ interval : 15s
197+ timeout : 5s
198+ retries : 3
199+ start_period : 10s
200+
157201 # ── Infrastructure ────────────────────────────────────────
158202
159203 postgres :
@@ -229,13 +273,35 @@ services:
229273 - POSTGRES_USER=teslasync
230274 - POSTGRES_PASSWORD=teslasync
231275 - POSTGRES_DB=teslasync
276+ - PROMETHEUS_URL=http://prometheus:9090
232277 volumes :
233278 - dev_grafana_data:/var/lib/grafana
234- - ./grafana/provisioning:/etc/grafana/provisioning
279+ - ./grafana/custom.ini:/etc/grafana/grafana.ini:ro
280+ - ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
281+ - ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
235282 - ./grafana/dashboards:/var/lib/grafana/dashboards
236283 depends_on :
237284 postgres :
238285 condition : service_healthy
286+ prometheus :
287+ condition : service_started
288+
289+ prometheus :
290+ image : prom/prometheus:v2.51.0
291+ container_name : teslasync-prometheus-dev
292+ restart : unless-stopped
293+ ports :
294+ - " 9099:9090"
295+ volumes :
296+ - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
297+ - ./helm/teslasync/files/prometheus/recording-rules.yaml:/etc/prometheus/rules/recording-rules.yaml:ro
298+ - ./helm/teslasync/files/prometheus/alerting-rules.yaml:/etc/prometheus/rules/alerting-rules.yaml:ro
299+ - dev_prometheus_data:/prometheus
300+ command :
301+ - ' --config.file=/etc/prometheus/prometheus.yml'
302+ - ' --storage.tsdb.retention.time=15d'
303+ - ' --web.enable-remote-write-receiver'
304+ - ' --enable-feature=exemplar-storage'
239305
240306 # ── Observability ─────────────────────────────────────────
241307
@@ -245,13 +311,46 @@ services:
245311 restart : unless-stopped
246312 ports :
247313 - " 16686:16686" # Jaeger UI
248- - " 4317:4317" # OTLP gRPC
249- - " 4318:4318" # OTLP HTTP
250314 environment :
251315 - COLLECTOR_OTLP_ENABLED=true
252316
317+ tempo :
318+ image : grafana/tempo:2.7.0
319+ container_name : teslasync-tempo-dev
320+ restart : unless-stopped
321+ command :
322+ - " -config.file=/etc/tempo/config.yaml"
323+ ports :
324+ - " 3200:3200"
325+ volumes :
326+ - ./observability/tempo/config.yaml:/etc/tempo/config.yaml:ro
327+ - dev_tempo_data:/var/tempo
328+ depends_on :
329+ prometheus :
330+ condition : service_started
331+
332+ otel-collector :
333+ image : otel/opentelemetry-collector-contrib:0.103.1
334+ container_name : teslasync-otel-collector-dev
335+ restart : unless-stopped
336+ command :
337+ - " --config=/etc/otelcol/config.yaml"
338+ volumes :
339+ - ./observability/otel-collector/config.yaml:/etc/otelcol/config.yaml:ro
340+ ports :
341+ - " 4317:4317"
342+ - " 4318:4318"
343+ - " 9464:9464"
344+ depends_on :
345+ jaeger :
346+ condition : service_started
347+ tempo :
348+ condition : service_started
349+
253350volumes :
254351 dev_postgres_data :
255352 dev_redis_data :
256353 dev_mosquitto_data :
257354 dev_grafana_data :
355+ dev_prometheus_data :
356+ dev_tempo_data :
0 commit comments