Files
han-app/VM1_app/codebase/backend/observability/docker-compose.yml
T

78 lines
2.5 KiB
YAML

services:
otel-queue-init:
image: ${OTEL_QUEUE_INIT_IMAGE:?OTEL_QUEUE_INIT_IMAGE must be pinned by digest}
command: ["sh", "-c", "chown 10001:10001 /queue && chmod 0700 /queue"]
volumes:
- otel-queue:/queue
networks: [observability]
restart: "no"
read_only: true
tmpfs: ["/tmp:size=8m,mode=1777"]
cap_drop: ["ALL"]
cap_add: ["CHOWN", "FOWNER"]
security_opt: ["no-new-privileges:true"]
pids_limit: 32
mem_limit: 32m
cpus: 0.25
otel-collector:
image: ${OTEL_COLLECTOR_IMAGE:?OTEL_COLLECTOR_IMAGE must be pinned by digest}
command: ["--config=/etc/otelcol/config.yaml"]
environment:
APP_ENV: ${APP_ENV:-production-like}
RELEASE_VERSION: ${RELEASE_VERSION:-unknown}
HOST_NAME: ${HOST_NAME:?HOST_NAME is required}
OTEL_REMOTE_ENDPOINT: ${OTEL_REMOTE_ENDPOINT}
OTEL_REMOTE_TLS_INSECURE: ${OTEL_REMOTE_TLS_INSECURE:-false}
expose: ["4317", "4318", "13133", "8888"]
volumes:
- ./otel-collector.yaml:/etc/otelcol/config.yaml:ro
- otel-queue:/var/lib/otelcol/queue
secrets:
- otel_remote_auth_header
networks: [observability, egress]
depends_on:
otel-queue-init: {condition: service_completed_successfully}
healthcheck:
test: ["CMD", "/otelcol-contrib", "validate", "--config=/etc/otelcol/config.yaml"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
read_only: true
tmpfs: ["/tmp:size=32m,mode=1777"]
user: "10001:10001"
cap_drop: ["ALL"]
security_opt: ["no-new-privileges:true"]
ulimits:
core: {soft: 0, hard: 0}
pids_limit: 128
mem_limit: 512m
cpus: 0.5
logging:
driver: json-file
options: {max-size: "50m", max-file: "5"}
otel-collector-local:
image: ${OTEL_COLLECTOR_IMAGE:?OTEL_COLLECTOR_IMAGE must be pinned by digest}
profiles: ["observability-local"]
command: ["--config=/etc/otelcol/config.yaml"]
expose: ["4317", "4318", "13133"]
volumes:
- ./otel-collector.local.yaml:/etc/otelcol/config.yaml:ro
networks: [observability]
healthcheck:
test: ["CMD", "/otelcol-contrib", "validate", "--config=/etc/otelcol/config.yaml"]
interval: 30s
timeout: 10s
retries: 3
read_only: true
tmpfs: ["/tmp:size=16m,mode=1777"]
user: "10001:10001"
cap_drop: ["ALL"]
security_opt: ["no-new-privileges:true"]
secrets:
otel_remote_auth_header:
file: ${HAN_SECRETS_DIR:-/run/han-chat/secrets}/OTEL_REMOTE_AUTH_HEADER