149 lines
3.5 KiB
YAML
149 lines
3.5 KiB
YAML
services:
|
|
|
|
postgres:
|
|
image: timescale/timescaledb:2.15.2-pg16
|
|
environment:
|
|
POSTGRES_USER: caatsm
|
|
POSTGRES_PASSWORD: caatsm
|
|
POSTGRES_DB: aviation
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./internal/repository/telegrams.ddl:/docker-entrypoint-initdb.d/01-telegrams.sql:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
networks:
|
|
- devnet
|
|
|
|
postgres-init:
|
|
image: timescale/timescaledb:2.15.2-pg16
|
|
depends_on:
|
|
- postgres
|
|
environment:
|
|
PGPASSWORD: caatsm
|
|
command: >
|
|
bash -c "
|
|
until pg_isready -h postgres -U caatsm; do sleep 1; done;
|
|
psql --host=postgres --username=caatsm --dbname=aviation --file=/tmp/telegrams.ddl
|
|
"
|
|
volumes:
|
|
- ./internal/repository/telegrams.ddl:/tmp/telegrams.ddl:ro
|
|
restart: "no"
|
|
networks:
|
|
- devnet
|
|
|
|
nats:
|
|
image: nats:2.10-alpine
|
|
command: ["-js", "--http_port=8222", "-DV"]
|
|
ports:
|
|
- "4222:4222"
|
|
- "8222:8222"
|
|
networks:
|
|
- devnet
|
|
|
|
nats-box:
|
|
image: synadia/nats-box:latest
|
|
entrypoint: ["sleep", "infinity"]
|
|
depends_on:
|
|
- nats
|
|
restart: unless-stopped
|
|
networks:
|
|
- devnet
|
|
|
|
nats-init:
|
|
image: synadia/nats-box:latest
|
|
depends_on:
|
|
- nats
|
|
command: >
|
|
/bin/sh -c "
|
|
echo 'waiting for NATS...' ;
|
|
until nats --server nats://nats:4222 server ping >/dev/null 2>&1; do sleep 1; done;
|
|
echo 'initializing JetStream...' ;
|
|
nats --server nats://nats:4222 stream add TELEGRAM \
|
|
--subjects 'telegram.serial,telegram.json' \
|
|
--storage file \
|
|
--retention limits \
|
|
--replicas 1 \
|
|
--max-msgs -1 \
|
|
--max-bytes -1 \
|
|
--if-not-exists \
|
|
--defaults
|
|
echo 'JetStream init done.';
|
|
sleep 2;
|
|
"
|
|
restart: "no"
|
|
networks:
|
|
- devnet
|
|
environment:
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
|
|
|
|
otel-collector:
|
|
image: otel/opentelemetry-collector-contrib:0.99.0
|
|
command:
|
|
- "--config=/etc/otelcol/config.yaml"
|
|
volumes:
|
|
- ./configs/otel-collector.dev.yaml:/etc/otelcol/config.yaml:ro
|
|
ports:
|
|
- "4317:4317"
|
|
- "4318:4318"
|
|
- "8888:8888"
|
|
- "8889:8889"
|
|
- "13133:13133"
|
|
- "55679:55679"
|
|
networks:
|
|
- devnet
|
|
|
|
jaeger:
|
|
image: jaegertracing/all-in-one:1.60
|
|
ports:
|
|
- "16686:16686"
|
|
- "14250:14250"
|
|
environment:
|
|
COLLECTOR_OTLP_ENABLED: "true"
|
|
LOG_LEVEL: debug
|
|
networks:
|
|
- devnet
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v2.53.0
|
|
command:
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
- "--storage.tsdb.path=/prometheus"
|
|
- "--web.enable-lifecycle"
|
|
- "--storage.tsdb.retention.time=1h"
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./configs/prometheus.dev.yml:/etc/prometheus/prometheus.yml:ro
|
|
networks:
|
|
- devnet
|
|
|
|
grafana:
|
|
image: grafana/grafana:11.2.2
|
|
environment:
|
|
GF_SECURITY_ADMIN_USER: admin
|
|
GF_SECURITY_ADMIN_PASSWORD: admin
|
|
GF_USERS_ALLOW_SIGN_UP: "false"
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- grafana-data:/var/lib/grafana
|
|
- ./configs/grafana-datasources.dev.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro
|
|
depends_on:
|
|
- prometheus
|
|
- jaeger
|
|
networks:
|
|
- devnet
|
|
|
|
volumes:
|
|
postgres-data:
|
|
grafana-data:
|
|
|
|
networks:
|
|
devnet:
|
|
driver: bridge
|