Hermes/docker-compose.yaml

187 lines
5.2 KiB
YAML

services:
postgres:
image: postgres:16.4-alpine
shm_size: 256mb
command: |
postgres
-c shared_preload_libraries=pg_stat_statements
-c pg_stat_statements.track=all
-c max_connections=200
-c shared_buffers=256MB
-c effective_cache_size=8GB
-c work_mem=16MB
-c maintenance_work_mem=128MB
-c min_wal_size=128MB
-c max_wal_size=2GB
-c checkpoint_completion_target=0.9
-c wal_buffers=16MB
-c default_statistics_target=100
healthcheck:
test: ["CMD-SHELL", "psql -U postgres -d postgres -c 'SELECT 1' || exit 1"]
interval: 2s
timeout: 10s
retries: 5
ports:
- 5432:5432
volumes:
- postgres-volume:/var/lib/postgresql/data
- ./sql:/docker-entrypoint-initdb.d
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
grafana:
image: grafana/grafana:11.1.4
shm_size: 256mb
ports:
- 3000:3000
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- grafana-volume:/var/lib/grafana
- ./deploy/grafana-ds.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
prometheus:
image: prom/prometheus:v2.54.0
shm_size: 256mb
user: root
ports:
- 9090:9090
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- prometheus-volume:/etc/prometheus
- ./deploy/prometheus.yml:/etc/prometheus/prometheus.yml
node_exporter:
image: quay.io/prometheus/node-exporter:latest
pid: host
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- 9100:9100
otel-collector:
image: otel/opentelemetry-collector-contrib:0.108.0
volumes:
- ./deploy/otel-collector.yaml:/etc/otelcol-contrib/config.yaml
ports:
- 8888:8888 # Prometheus metrics exposed by the Collector
- 8889:8889 # Prometheus exporter metrics
- 13133:13133 # health_check extension
# - 4317:4317 # OTLP gRPC receiver
- 4318:4318 # OTLP http receiver
tempo-init:
image: &tempoImage grafana/tempo:r177-60780f7
user: root
entrypoint:
- "chown"
- "10001:10001"
- "/var/tempo"
volumes:
- tempo-volume:/var/tempo
tempo:
image: *tempoImage
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- ./deploy/tempo.yaml:/etc/tempo.yaml
- tempo-volume:/var/tempo
depends_on:
- tempo-init
kafka:
image: &kafkaImage apache/kafka:3.8.0
healthcheck:
test: ["CMD-SHELL", "/opt/kafka/bin/kafka-cluster.sh cluster-id --bootstrap-server http://kafka:9092 || exit 1"]
interval: 1s
timeout: 30s
retries: 30
environment:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: BACKEND://0.0.0.0:9091, BROKER://kafka:9092, CONTROLLER://kafka:9093
KAFKA_ADVERTISED_LISTENERS: BACKEND://localhost:9091, BROKER://kafka:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: BACKEND:PLAINTEXT, BROKER:PLAINTEXT, CONTROLLER:PLAINTEXT
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_NUM_PARTITIONS: 3
ports:
- 9091:9091
kafka-init:
image: *kafkaImage
depends_on:
kafka:
condition: service_healthy
entrypoint: >
/bin/bash -c "/opt/kafka/bin/kafka-topics.sh --bootstrap-server http://kafka:9092 --create --topic events --partitions 6"
minio:
image: quay.io/minio/minio:latest
command: ["server", "/data", "--console-address", ":9001"]
healthcheck:
test: 'mc ready local'
interval: 1s
environment:
MINIO_ROOT_USER: miniouser
MINIO_ROOT_PASSWORD: miniouser
MINIO_ACCESS_KEY: miniokey
MINIO_SECRET_KEY: miniokey
ports:
- 9000:9000
- 9001:9001
volumes:
- minio-volume:/data
minio-init:
image: quay.io/minio/mc:latest
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 miniouser miniouser;
/usr/bin/mc mb minio/bucket;
/usr/bin/mc anonymous set public minio/bucket;
exit 0;
"
smtp4dev:
image: rnwood/smtp4dev:v3
restart: always
ports:
- '12332:80' #WebUI
- '12333:25' #SMTP
- '12334:143' #IMAP
# volumes:
# - smtp4dev-data:/smtp4dev
environment:
- ServerOptions__Urls=http://*:80
- ServerOptions__HostName=localhost
- ServerOptions__TlsMode=None
- RelayOptions__Login=maillogin
- RelayOptions__Password=mailpass
volumes:
postgres-volume:
grafana-volume:
tempo-volume:
prometheus-volume:
minio-volume: