name: mtusi-lab7-maslov services: postgres: image: library/postgres:18.7@sha256:eb63372c1e05c755f55fa30cbd07aecc443676fc6c0fa90b9002d01537841e1a environment: POSTGRES_USER: messenger POSTGRES_DB: messenger POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password PGDATA: /var/lib/postgresql/data/pgdata secrets: - postgres_password volumes: - postgres_data:/var/lib/postgresql healthcheck: test: - CMD-SHELL - pg_isready -U messenger -d messenger interval: 2s timeout: 2s retries: 20 cpus: 1 mem_limit: 512m memswap_limit: 512m security_opt: - no-new-privileges:true read_only: true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m - /var/run/postgresql:rw,nosuid,size=4m command: - postgres - -c - listen_addresses=127.0.0.1 cap_drop: - ALL cap_add: - CHOWN - FOWNER - SETUID - SETGID - DAC_OVERRIDE cache: image: valkey/valkey:8.1.12@sha256:5032c4dd7abe08d6fd9382054608183e2bf1f7e3895ef619b8784698454325f7 command: - valkey-server - /run/secrets/valkey.conf secrets: - source: cache_config target: cache.conf - cache_admin healthcheck: test: - CMD-SHELL - REDISCLI_AUTH="$$(cat /run/secrets/cache_admin)" valkey-cli --user admin ping interval: 2s timeout: 2s retries: 20 cpus: 0.25 mem_limit: 128m memswap_limit: 128m cap_drop: - ALL security_opt: - no-new-privileges:true read_only: true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m user: 999:999 migrate: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never command: - python - -m - src.runtime - src.migrate environment: IDENTITY_ENABLED: '1' SERVICE_ROLE: migrate OTEL_EXPORTER_OTLP_ENDPOINT: http://127.0.0.1:14318 secrets: [] depends_on: identity-migrate: condition: service_started cpus: 0.5 mem_limit: 256m read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_migrate:/run/identity:ro profiles: - maintenance healthcheck: disable: true api: image: ${API_IMAGE:-mtusi-messenger:lab7} build: context: . args: VCS_REF: ${VCS_REF:-unknown} scale: ${API_REPLICAS:-2} environment: APP_HOST: 127.0.0.1 APP_PORT: '8080' SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600} DB_POOL_SIZE: ${DB_POOL_SIZE:-10} OTEL_ENABLED: ${OTEL_ENABLED:-1} OTEL_EXPORTER_OTLP_ENDPOINT: http://127.0.0.1:14318 APP_VERSION: ${VCS_REF:-development} IDENTITY_ENABLED: '1' SERVICE_ROLE: api secrets: [] depends_on: identity-api: condition: service_started cpus: ${API_CPUS:-1} mem_limit: 768m memswap_limit: 768m pids_limit: 128 read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=128m cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 10s volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_api:/run/identity:ro command: - python - -m - src.runtime - src healthcheck: test: - CMD - python - -c - import urllib.request;urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).read() interval: 3s timeout: 3s start_period: 45s retries: 15 s3: image: ${S3_IMAGE:-mtusi-storage:lab7-minio-20251015} build: context: . dockerfile: infra/s3.Dockerfile target: server secrets: - s3_root_user - s3_root_password volumes: - s3_data:/data cpus: 1 mem_limit: 1024m memswap_limit: 1024m read_only: true tmpfs: - /tmp:rw,nosuid,size=32m environment: HOME: /tmp security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 ports: - 127.0.0.1:${S3_ADMIN_PORT:-9007}:9443 reconciler: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never command: - python - -m - src.runtime - src.reconcile - --apply - --loop environment: STAGING_RETENTION_SECONDS: ${STAGING_RETENTION_SECONDS:-86400} IDENTITY_ENABLED: '1' SERVICE_ROLE: reconciler OTEL_EXPORTER_OTLP_ENDPOINT: http://127.0.0.1:14318 secrets: [] depends_on: identity-reconciler: condition: service_started cpus: 0.25 mem_limit: 256m memswap_limit: 256m read_only: true healthcheck: disable: true cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_reconciler:/run/identity:ro broker: image: valkey/valkey:8.1.12@sha256:5032c4dd7abe08d6fd9382054608183e2bf1f7e3895ef619b8784698454325f7 command: - valkey-server - /run/secrets/broker.conf secrets: - source: broker_config target: broker.conf - broker_admin volumes: - broker_data:/data healthcheck: test: - CMD-SHELL - REDISCLI_AUTH="$$(cat /run/secrets/broker_admin)" valkey-cli --user admin ping interval: 2s timeout: 2s retries: 20 cpus: 0.5 mem_limit: 256m memswap_limit: 256m cap_drop: - ALL security_opt: - no-new-privileges:true read_only: true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m user: 999:999 depends_on: identity-init: condition: service_completed_successfully relay: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never command: - python - -m - src.runtime - src.pipeline environment: JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5} OTEL_ENABLED: ${OTEL_ENABLED:-1} OTEL_EXPORTER_OTLP_ENDPOINT: http://127.0.0.1:14318 APP_VERSION: ${VCS_REF:-development} IDENTITY_ENABLED: '1' SERVICE_ROLE: relay secrets: [] depends_on: identity-relay: condition: service_started cpus: 0.25 mem_limit: 192m memswap_limit: 192m read_only: true healthcheck: disable: true cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_relay:/run/identity:ro worker: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never command: - python - -m - src.runtime - src.worker environment: WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-2} JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5} JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-20} JOB_LEASE_SECONDS: ${JOB_LEASE_SECONDS:-23} OTEL_ENABLED: ${OTEL_ENABLED:-1} OTEL_EXPORTER_OTLP_ENDPOINT: http://127.0.0.1:14318 APP_VERSION: ${VCS_REF:-development} IDENTITY_ENABLED: '1' SERVICE_ROLE: worker secrets: [] depends_on: identity-worker: condition: service_started cpus: 2 mem_limit: 1536m memswap_limit: 1536m pids_limit: 128 read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=64m healthcheck: disable: true cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 25s volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_worker:/run/identity:ro lb: image: library/haproxy:3.2.27-alpine@sha256:7816a9801a6846b912bc37e48529808e2fa87c3c47992441940f68e393ebcfeb ports: - 127.0.0.1:${PUBLIC_PORT:-8443}:8443 volumes: - ./infra/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro - ./trust:/trust:ro - identity_lb:/run/identity:ro depends_on: identity-init: condition: service_completed_successfully cpus: 0.5 mem_limit: 128m memswap_limit: 128m read_only: true tmpfs: - /tmp:rw,nosuid,size=4m security_opt: - no-new-privileges:true stop_grace_period: 10s cap_drop: - ALL pids_limit: 128 user: 99:99 entrypoint: - haproxy command: - -W - -db - -f - /usr/local/etc/haproxy/haproxy.cfg observer: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never command: - python - -m - src.runtime - src.observer environment: OTEL_ENABLED: ${OTEL_ENABLED:-1} OTEL_EXPORTER_OTLP_ENDPOINT: http://127.0.0.1:14318 APP_VERSION: ${VCS_REF:-development} IDENTITY_ENABLED: '1' SERVICE_ROLE: observer secrets: [] depends_on: identity-observer: condition: service_started cpus: 0.25 mem_limit: 192m memswap_limit: 192m read_only: true healthcheck: disable: true cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_observer:/run/identity:ro otel: image: otel/opentelemetry-collector-contrib:0.165.0@sha256:e40d61f10c9a617cca1ffd1be4d7e2b3a4b0f0001798ff07e58cabe82e618cea user: 10001:10001 volumes: - ./infra/otel/collector.yaml:/etc/otel/config.yaml:ro - ./trust:/trust:ro - identity_otel:/run/identity:ro cpus: 0.5 mem_limit: 384m memswap_limit: 384m environment: GOMEMLIMIT: 224MiB read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=32m cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 command: - --config=/etc/otel/config.yaml prometheus: image: prom/prometheus:v3.16.0@sha256:e04987641b57704f408e31f6373ba4138ecf27cb4a165d24aabb6c38fddd0f06 user: 65534:65534 volumes: - ./infra/otel/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro - ./infra/otel/alerts.yaml:/etc/prometheus/alerts.yaml:ro - prometheus_data:/prometheus - ./trust:/trust:ro - identity_prometheus:/run/identity:ro cpus: 0.5 mem_limit: 384m memswap_limit: 384m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=32m cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 command: - --config.file=/etc/prometheus/prometheus.yaml - --storage.tsdb.path=/prometheus - --storage.tsdb.retention.time=24h - --storage.tsdb.retention.size=256MB - --web.listen-address=127.0.0.1:9090 depends_on: telemetry-init: condition: service_completed_successfully loki: image: grafana/loki:3.7.10@sha256:b43c257ccfc925d4a50b8717cac61a3b51df8c48d01847936057e5c4075a24a7 user: 10001:10001 volumes: - ./infra/otel/loki.yaml:/etc/loki/config.yaml:ro - loki_data:/loki - ./trust:/trust:ro - identity_loki:/run/identity:ro cpus: 0.5 mem_limit: 384m memswap_limit: 384m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=32m cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 command: - -config.file=/etc/loki/config.yaml depends_on: telemetry-init: condition: service_completed_successfully tempo: image: grafana/tempo:3.1.1@sha256:64e2fbd56d9c2b3412a4b430a58ea59e91a670b1e75f920a0c702213ad145044 user: 10001:10001 volumes: - ./infra/otel/tempo.yaml:/etc/tempo/config.yaml:ro - tempo_data:/var/tempo - ./trust:/trust:ro - identity_tempo:/run/identity:ro cpus: 0.5 mem_limit: 768m memswap_limit: 768m environment: GOMEMLIMIT: 384MiB read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=32m cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 command: - -config.file=/etc/tempo/config.yaml depends_on: telemetry-init: condition: service_completed_successfully grafana: image: grafana/grafana:13.3.1@sha256:0615ec4fbd4072004b7d86b46ded63013a74b7d6eb1119273dd89e8fa25c13cf user: 472:472 volumes: - ./infra/grafana/provisioning:/etc/grafana/provisioning:ro - ./infra/grafana/dashboards:/var/lib/grafana/dashboards:ro - grafana_data:/var/lib/grafana - ./trust:/trust:ro - identity_grafana:/run/identity:ro cpus: 0.5 mem_limit: 384m memswap_limit: 384m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=32m cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 environment: GF_SECURITY_ADMIN_USER: admin GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_password GF_AUTH_ANONYMOUS_ENABLED: 'false' GF_USERS_ALLOW_SIGN_UP: 'false' GF_ANALYTICS_REPORTING_ENABLED: 'false' GF_ANALYTICS_CHECK_FOR_UPDATES: 'false' GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES: 'false' GF_PLUGINS_PREINSTALL_DISABLED: 'true' GF_LOG_LEVEL: warn GOMEMLIMIT: 256MiB GF_SERVER_HTTP_ADDR: 127.0.0.1 GF_SECURITY_COOKIE_SECURE: 'true' GF_SERVER_ROOT_URL: https://localhost:${GRAFANA_PORT:-3447} secrets: - grafana_password ports: - 127.0.0.1:${GRAFANA_PORT:-3447}:3443 depends_on: telemetry-init: condition: service_completed_successfully telemetry-init: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 0:0 command: - python - -c - import os; [(os.makedirs(p,exist_ok=True),os.chown(p,u,u)) for p,u in [('/data/prometheus',65534),('/data/loki',10001),('/data/tempo',10001),('/data/grafana',472)]] volumes: - prometheus_data:/data/prometheus - loki_data:/data/loki - tempo_data:/data/tempo - grafana_data:/data/grafana read_only: true cap_drop: - ALL cap_add: - CHOWN security_opt: - no-new-privileges:true cpus: 0.1 mem_limit: 64m healthcheck: disable: true pids_limit: 128 tmpfs: - /tmp:rw,noexec,nosuid,size=32m identity-openbao: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 1000:1000 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-openbao.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_openbao:/run/identity - ./secrets/bootstrap/openbao:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped identity-api: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-api.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_api:/run/identity - ./secrets/bootstrap/api:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped identity-worker: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-worker.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_worker:/run/identity - ./secrets/bootstrap/worker:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped identity-relay: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-relay.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_relay:/run/identity - ./secrets/bootstrap/relay:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped identity-observer: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-observer.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_observer:/run/identity - ./secrets/bootstrap/observer:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped identity-reconciler: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-reconciler.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_reconciler:/run/identity - ./secrets/bootstrap/reconciler:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped identity-migrate: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-migrate.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_migrate:/run/identity - ./secrets/bootstrap/migrate:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true profiles: - maintenance identity-lb: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 99:99 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-lb.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_lb:/run/identity - ./secrets/bootstrap/lb:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped pid: service:lb depends_on: lb: condition: service_started lb-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 99:99 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/lb.json network_mode: service:lb volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_lb:/run/identity:ro depends_on: lb: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-postgres: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-postgres.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_postgres:/run/identity - ./secrets/bootstrap/postgres:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped postgres-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/postgres.json network_mode: service:postgres volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_postgres:/run/identity:ro depends_on: postgres: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-s3: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-s3.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_s3:/run/identity - ./secrets/bootstrap/s3:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped s3-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/s3.json network_mode: service:s3 volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_s3:/run/identity:ro depends_on: s3: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-broker: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-broker.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_broker:/run/identity - ./secrets/bootstrap/broker:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped broker-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/broker.json network_mode: service:broker volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_broker:/run/identity:ro depends_on: broker: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-cache: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-cache.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_cache:/run/identity - ./secrets/bootstrap/cache:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped cache-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/cache.json network_mode: service:cache volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_cache:/run/identity:ro depends_on: cache: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-otel: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-otel.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_otel:/run/identity - ./secrets/bootstrap/otel:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped otel-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/otel.json network_mode: service:otel volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_otel:/run/identity:ro depends_on: otel: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-prometheus: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 65534:65534 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-prometheus.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_prometheus:/run/identity - ./secrets/bootstrap/prometheus:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped prometheus-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 65534:65534 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/prometheus.json network_mode: service:prometheus volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_prometheus:/run/identity:ro depends_on: prometheus: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-loki: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-loki.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_loki:/run/identity - ./secrets/bootstrap/loki:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped loki-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/loki.json network_mode: service:loki volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_loki:/run/identity:ro depends_on: loki: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-tempo: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-tempo.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_tempo:/run/identity - ./secrets/bootstrap/tempo:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped tempo-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 10001:10001 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/tempo.json network_mode: service:tempo volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_tempo:/run/identity:ro depends_on: tempo: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true identity-grafana: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 472:472 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/agent-grafana.json volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_grafana:/run/identity - ./secrets/bootstrap/grafana:/bootstrap:ro cpus: 0.1 mem_limit: 64m memswap_limit: 64m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m cap_drop: - ALL pids_limit: 32 security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 32MiB healthcheck: disable: true restart: unless-stopped grafana-tls: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 472:472 entrypoint: - /usr/local/bin/tls-gateway command: - /etc/tls/grafana.json network_mode: service:grafana volumes: - ./infra/tls:/etc/tls:ro - ./trust:/trust:ro - identity_grafana:/run/identity:ro depends_on: grafana: condition: service_started cpus: 0.15 mem_limit: 96m memswap_limit: 96m read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=4m pids_limit: 64 cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 48MiB healthcheck: disable: true openbao: image: openbao/openbao:2.7.3@sha256:ba4b133eb9586630024e71a617e66f37f29cc3534cdd46a6233e098ceded8dc9 user: 1000:1000 entrypoint: - bao command: - server - -config=/etc/openbao/config.hcl volumes: - ./infra/openbao/config.hcl:/etc/openbao/config.hcl:ro - ./trust:/trust:ro - identity_openbao:/run/identity:ro - openbao_data:/data ports: - 127.0.0.1:${BAO_PORT:-8207}:8200 environment: BAO_LOG_LEVEL: warn cpus: 0.5 mem_limit: 256m memswap_limit: 256m pids_limit: 128 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true tmpfs: - /tmp:rw,noexec,nosuid,size=16m depends_on: identity-init: condition: service_completed_successfully identity-init: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never user: 0:0 command: - python - -m - src.identity_init volumes: - ./secrets/bootstrap:/bootstrap:ro - openbao_data:/data/openbao - broker_data:/data/broker - identity_openbao:/identity/openbao - identity_api:/identity/api - identity_worker:/identity/worker - identity_relay:/identity/relay - identity_observer:/identity/observer - identity_reconciler:/identity/reconciler - identity_migrate:/identity/migrate - identity_lb:/identity/lb - identity_postgres:/identity/postgres - identity_s3:/identity/s3 - identity_broker:/identity/broker - identity_cache:/identity/cache - identity_otel:/identity/otel - identity_prometheus:/identity/prometheus - identity_loki:/identity/loki - identity_tempo:/identity/tempo - identity_grafana:/identity/grafana environment: IDENTITY_OWNERS: '{"openbao": 1000, "api": 10001, "worker": 10001, "relay": 10001, "observer": 10001, "reconciler": 10001, "migrate": 10001, "lb": 99, "postgres": 10001, "s3": 10001, "broker": 10001, "cache": 10001, "otel": 10001, "prometheus": 65534, "loki": 10001, "tempo": 10001, "grafana": 472}' cpus: 0.1 mem_limit: 64m read_only: true cap_drop: - ALL cap_add: - CHOWN - DAC_OVERRIDE security_opt: - no-new-privileges:true healthcheck: disable: true operator-probe: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never profiles: - operator user: 0:0 entrypoint: - python command: - -m - src.security_probe volumes: - ./trust:/trust:ro - ./secrets/probe:/probe-fixtures:ro - identity_openbao:/identities/openbao:ro - identity_api:/identities/api:ro - identity_worker:/identities/worker:ro - identity_relay:/identities/relay:ro - identity_observer:/identities/observer:ro - identity_reconciler:/identities/reconciler:ro - identity_migrate:/identities/migrate:ro - identity_lb:/identities/lb:ro - identity_postgres:/identities/postgres:ro - identity_s3:/identities/s3:ro - identity_broker:/identities/broker:ro - identity_cache:/identities/cache:ro - identity_otel:/identities/otel:ro - identity_prometheus:/identities/prometheus:ro - identity_loki:/identities/loki:ro - identity_tempo:/identities/tempo:ro - identity_grafana:/identities/grafana:ro cap_drop: - ALL cap_add: - DAC_READ_SEARCH security_opt: - no-new-privileges:true read_only: true tmpfs: - /tmp:rw,noexec,nosuid,size=8m cpus: 0.5 mem_limit: 192m pids_limit: 64 healthcheck: disable: true operator-task: image: ${API_IMAGE:-mtusi-messenger:lab7} pull_policy: never profiles: - operator entrypoint: - python - -m - src.operator user: 10001:10001 environment: IDENTITY_ENABLED: '1' volumes: - ./secrets/operator-task:/run/identity:ro - ./trust:/trust:ro read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true tmpfs: - /tmp:rw,noexec,nosuid,size=8m cpus: 0.5 mem_limit: 192m pids_limit: 64 healthcheck: disable: true secrets: postgres_password: file: ./secrets/postgres_password s3_root_user: file: ./secrets/s3_root_user s3_root_password: file: ./secrets/s3_root_password grafana_password: file: ./secrets/grafana_password broker_admin: file: ./secrets/broker_admin cache_admin: file: ./secrets/cache_admin broker_config: file: ./secrets/broker.conf cache_config: file: ./secrets/cache.conf volumes: broker_data: null s3_data: null postgres_data: null prometheus_data: null loki_data: null tempo_data: null grafana_data: null identity_openbao: null identity_api: null identity_worker: null identity_relay: null identity_observer: null identity_reconciler: null identity_migrate: null identity_lb: null identity_postgres: null identity_s3: null identity_broker: null identity_cache: null identity_otel: null identity_prometheus: null identity_loki: null identity_tempo: null identity_grafana: null openbao_data: null