services: telemetry-init: image: mtusi-messenger:lab7 cpus: 1.0 mem_limit: 256m pids_limit: 64 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 35s logging: driver: json-file options: max-size: 5m max-file: '2' user: 0:0 cap_add: - CHOWN - FOWNER command: - python - -c - import os; [(os.chown(p,u,g),os.chmod(p,0o750)) for p,u,g in [('/bao',10001,10001),('/grafana',472,472),('/prometheus',65534,65534),('/loki',10001,10001),('/tempo',10001,10001),('/pg',999,999),('/broker',999,1000)]] healthcheck: disable: true volumes: - grafanadata:/grafana - prometheusdata:/prometheus - lokidata:/loki - tempodata:/tempo - baodata:/bao - pgdata:/pg - brokerdata:/broker otel-collector: image: mirror.gcr.io/otel/opentelemetry-collector-contrib@sha256:ffc818ee108d0b934fd14207fd87ff247c9b64f344ed349d0b66c166c18a2312 command: - --config=/etc/otel/config.yaml volumes: - ./infra/otel-collector.yaml:/etc/otel/config.yaml:ro mem_limit: 256m cpus: 0.5 environment: GOMEMLIMIT: 192MiB GOMAXPROCS: '2' read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' prometheus: image: mirror.gcr.io/prom/prometheus@sha256:efd719c99d83b060d9daefdcf00360461adf279f45ef5391f8d111892118753e 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 volumes: - ./infra/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro - ./infra/alerts.yaml:/etc/prometheus/alerts.yaml:ro - prometheusdata:/prometheus mem_limit: 256m cpus: 0.5 security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' depends_on: telemetry-init: condition: service_completed_successfully read_only: true tmpfs: - /tmp:size=32m,mode=1777 loki: image: mirror.gcr.io/grafana/loki@sha256:3c8fd3570dd9219951a60d3f919c7f31923d10baee578b77bc26c4a0b32d092d command: - -config.file=/etc/loki/config.yaml volumes: - ./infra/loki.yaml:/etc/loki/config.yaml:ro - lokidata:/var/loki mem_limit: 256m cpus: 0.5 environment: GOMEMLIMIT: 192MiB GOMAXPROCS: '2' security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' depends_on: telemetry-init: condition: service_completed_successfully read_only: true tmpfs: - /tmp:size=32m,mode=1777 tempo: image: mirror.gcr.io/grafana/tempo@sha256:d7f4c72e0bad2b42b4e7263b0addaf3f5bbc105cec6b1917eba0aae3b9b70364 command: - -config.file=/etc/tempo/config.yaml volumes: - ./infra/tempo.yaml:/etc/tempo/config.yaml:ro - tempodata:/var/tempo mem_limit: 256m cpus: 0.5 environment: GOMEMLIMIT: 192MiB GOMAXPROCS: '2' security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' depends_on: telemetry-init: condition: service_completed_successfully read_only: true tmpfs: - /tmp:size=32m,mode=1777 grafana: image: mirror.gcr.io/grafana/grafana@sha256:dbbc38ea21103cefb50396340cd88afec779c7e070b0a7bf5a75b4ce46651d3f environment: GF_SECURITY_ADMIN_USER: admin GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/password GF_USERS_ALLOW_SIGN_UP: 'false' GF_ANALYTICS_REPORTING_ENABLED: 'false' GF_ANALYTICS_CHECK_FOR_UPDATES: 'false' GOMEMLIMIT: 384MiB GOMAXPROCS: '2' GF_SERVER_PROTOCOL: https GF_SERVER_CERT_FILE: /identity/cert.pem GF_SERVER_CERT_KEY: /identity/key.pem volumes: - grafanadata:/var/lib/grafana - ./infra/grafana/provisioning:/etc/grafana/provisioning:ro - ./infra/grafana/dashboards:/var/lib/grafana/dashboards:ro - config-grafana:/run/secrets:ro - identity-grafana:/identity:ro mem_limit: 512m cpus: 1.0 security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' ports: - 127.0.0.1:3000:3000 depends_on: telemetry-init: condition: service_completed_successfully secret-init: condition: service_completed_successfully read_only: true tmpfs: - /tmp:size=32m,mode=1777 db: image: mirror.gcr.io/library/postgres@sha256:3645570cccdfa447589da9f57dd740faa29b30938e861289a5574b6ca6b03826 environment: POSTGRES_USER: messenger POSTGRES_DB: messenger POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Run python scripts/bootstrap.py} command: - postgres - -c - shared_buffers=64MB - -c - max_connections=30 - -c - listen_addresses=127.0.0.1 - -c - hba_file=/etc/postgresql/pg_hba.conf volumes: - pgdata:/var/lib/postgresql/data - ./infra/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro cpus: 1.0 mem_limit: 256m healthcheck: test: - CMD-SHELL - pg_isready -U messenger -d messenger interval: 2s timeout: 2s retries: 20 security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' user: 999:999 tmpfs: - /var/run/postgresql:uid=999,gid=999,mode=0700 - /tmp:size=32m,mode=1777 depends_on: telemetry-init: condition: service_completed_successfully read_only: true cache: image: mirror.gcr.io/valkey/valkey@sha256:081c2f5cb575efc901aa80ff9cdbd1ec6a301682fd35e1ebb4b0990a4a4a8507 command: - valkey-server - /etc/valkey/lab.conf cpus: 0.25 mem_limit: 64m security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' volumes: - config-cache:/etc/valkey:ro user: 999:1000 depends_on: telemetry-init: condition: service_completed_successfully secret-init: condition: service_completed_successfully read_only: true tmpfs: - /tmp:size=32m,mode=1777 - /data:uid=999,gid=1000,size=1m s3: image: chrislusf/seaweedfs@sha256:ccad23e18639c8b98cee17e7100b95830a06077b56d8e5b006d6dcf8ec5e94a0 user: 1000:1000 command: - server - -dir=/data - -ip=127.0.0.1 - -ip.bind=127.0.0.1 - -s3 - -s3.ip.bind=127.0.0.1 - -s3.config=/etc/seaweedfs/s3.json - -s3.port.iceberg=0 - -s3.port.lance=0 - -s3.autoCreateBucket=false - -volume.max=10 - -master.volumeSizeLimitMB=100 - -filer.concurrentUploadLimitMB=64 environment: GOMEMLIMIT: 384MiB GOMAXPROCS: '2' volumes: - s3data:/data - config-s3:/etc/seaweedfs:ro cpus: 1.0 mem_limit: 512m cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 20s pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' depends_on: secret-init: condition: service_completed_successfully read_only: true tmpfs: - /tmp:size=32m,mode=1777 reconciler: image: mtusi-messenger:lab7 cpus: 0.25 mem_limit: 192m pids_limit: 64 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 35s logging: driver: json-file options: max-size: 5m max-file: '2' command: - python - -m - src.secret_agent - python - -m - src.cleanup healthcheck: disable: true environment: SERVICE_ROLE: reconciler APP_HOST: 127.0.0.1 volumes: - identity-reconciler:/identity:ro - ./secrets/trust:/trust:ro depends_on: secret-init: condition: service_completed_successfully broker: image: mirror.gcr.io/valkey/valkey@sha256:081c2f5cb575efc901aa80ff9cdbd1ec6a301682fd35e1ebb4b0990a4a4a8507 command: - valkey-server - /etc/valkey/lab.conf volumes: - brokerdata:/data - config-broker:/etc/valkey:ro cpus: 0.25 mem_limit: 128m security_opt: - no-new-privileges:true cap_drop: - ALL pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' user: 999:1000 depends_on: telemetry-init: condition: service_completed_successfully secret-init: condition: service_completed_successfully read_only: true tmpfs: - /tmp:size=32m,mode=1777 dispatcher: image: mtusi-messenger:lab7 cpus: 0.25 mem_limit: 128m pids_limit: 64 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 35s logging: driver: json-file options: max-size: 5m max-file: '2' tmpfs: - /tmp:size=32m,mode=1777 command: - python - -m - src.secret_agent - python - -m - src.dispatcher healthcheck: disable: true environment: SERVICE_ROLE: dispatcher APP_HOST: 127.0.0.1 volumes: - identity-dispatcher:/identity:ro - ./secrets/trust:/trust:ro depends_on: secret-init: condition: service_completed_successfully worker: image: mtusi-messenger:lab7 cpus: 1.0 mem_limit: 768m pids_limit: 64 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 35s logging: driver: json-file options: max-size: 5m max-file: '2' tmpfs: - /tmp:size=64m,mode=1777 command: - python - -m - src.secret_agent - python - -m - src.worker healthcheck: disable: true environment: SERVICE_ROLE: worker APP_HOST: 127.0.0.1 volumes: - identity-worker:/identity:ro - ./secrets/trust:/trust:ro depends_on: secret-init: condition: service_completed_successfully lb: image: mirror.gcr.io/library/haproxy@sha256:b9fe316f718d5015c5cfebd8ca019591f3e44656f61d93cb8b59a1028961e530 volumes: - ./infra/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro - identity-lb:/identity:ro - ./secrets/trust:/trust:ro cpus: 0.5 mem_limit: 64m read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true pids_limit: 128 logging: driver: json-file options: max-size: 5m max-file: '2' ports: - 127.0.0.1:8443:8443 user: 10001:10001 depends_on: secret-init: condition: service_completed_successfully api1: image: mtusi-messenger:lab7 cpus: 0.5 mem_limit: 512m pids_limit: 64 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 35s logging: driver: json-file options: max-size: 5m max-file: '2' tmpfs: - /tmp:size=32m,mode=1777 environment: SERVICE_ROLE: api1 APP_HOST: 127.0.0.1 volumes: - identity-api1:/identity:ro - ./secrets/trust:/trust:ro command: - python - -m - src.secret_agent - python - -m - src build: . depends_on: secret-init: condition: service_completed_successfully api2: image: mtusi-messenger:lab7 cpus: 0.5 mem_limit: 512m pids_limit: 64 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true stop_grace_period: 35s logging: driver: json-file options: max-size: 5m max-file: '2' tmpfs: - /tmp:size=32m,mode=1777 environment: SERVICE_ROLE: api2 APP_HOST: 127.0.0.1 volumes: - identity-api2:/identity:ro - ./secrets/trust:/trust:ro command: - python - -m - src.secret_agent - python - -m - src depends_on: secret-init: condition: service_completed_successfully openbao: image: quay.io/openbao/openbao@sha256:5046911075e137e154ce49ab051502f4ec7cf367d484ae4a4dce665d9b90561f user: 10001:10001 entrypoint: - bao command: - server - -config=/etc/bao/config.hcl volumes: - ./infra/openbao.hcl:/etc/bao/config.hcl:ro - identity-openbao:/identity:ro - ./secrets/trust:/trust:ro - baodata:/bao ports: - 127.0.0.1:8200:8200 mem_limit: 256m memswap_limit: 256m pids_limit: 128 cpus: 0.5 read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true environment: GOMEMLIMIT: 192MiB depends_on: telemetry-init: condition: service_completed_successfully secret-init: condition: service_completed_successfully api1-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:api1 depends_on: api1: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/api1.json:/proxy.json:ro - identity-api1:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 api2-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:api2 depends_on: api2: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/api2.json:/proxy.json:ro - identity-api2:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 db-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:db depends_on: db: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/db.json:/proxy.json:ro - identity-db:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 s3-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:s3 depends_on: s3: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/s3.json:/proxy.json:ro - identity-s3:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 cache-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:cache depends_on: cache: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/cache.json:/proxy.json:ro - identity-cache:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 broker-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:broker depends_on: broker: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/broker.json:/proxy.json:ro - identity-broker:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 otel-collector-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:otel-collector depends_on: otel-collector: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/otel-collector.json:/proxy.json:ro - identity-otel-collector:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 tempo-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:tempo depends_on: tempo: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/tempo.json:/proxy.json:ro - identity-tempo:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 loki-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:loki depends_on: loki: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/loki.json:/proxy.json:ro - identity-loki:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 prometheus-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:prometheus depends_on: prometheus: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/prometheus.json:/proxy.json:ro - identity-prometheus:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 worker-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:worker depends_on: worker: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/worker.json:/proxy.json:ro - identity-worker:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 dispatcher-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:dispatcher depends_on: dispatcher: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/dispatcher.json:/proxy.json:ro - identity-dispatcher:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 reconciler-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:reconciler depends_on: reconciler: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/reconciler.json:/proxy.json:ro - identity-reconciler:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 grafana-tls: image: mtusi-messenger:lab7 command: - python - -m - src.tls_proxy network_mode: service:grafana depends_on: grafana: condition: service_started secret-init: condition: service_completed_successfully volumes: - ./infra/mesh/grafana.json:/proxy.json:ro - identity-grafana:/identity:ro - ./secrets/trust:/trust:ro healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.2 pids_limit: 32 storage-init: image: mtusi-messenger:lab7 network_mode: service:s3 env_file: .env.storage-admin command: - python - -m - src.bootstrap_storage profiles: - operator healthcheck: disable: true read_only: true cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 128m cpus: 0.5 volumes: [] secret-init: image: mtusi-messenger:lab7 user: 0:0 command: - python - -m - src.secret_mounts read_only: true cap_drop: - ALL cap_add: - CHOWN - FOWNER - DAC_OVERRIDE security_opt: - no-new-privileges:true mem_limit: 64m cpus: 0.5 pids_limit: 32 healthcheck: disable: true volumes: - ./secrets/cache.conf:/source/cache.conf:ro - ./secrets/broker.conf:/source/broker.conf:ro - ./secrets/s3.json:/source/s3.json:ro - ./secrets/grafana-password:/source/grafana-password:ro - identity-grafana:/output/grafana - identity-reconciler:/output/reconciler - identity-dispatcher:/output/dispatcher - identity-worker:/output/worker - identity-lb:/output/lb - identity-api1:/output/api1 - identity-api2:/output/api2 - identity-openbao:/output/openbao - identity-db:/output/db - identity-s3:/output/s3 - identity-cache:/output/cache - identity-broker:/output/broker - identity-otel-collector:/output/otel-collector - identity-tempo:/output/tempo - identity-loki:/output/loki - identity-prometheus:/output/prometheus - config-s3:/configs/s3 - config-cache:/configs/cache - config-broker:/configs/broker - config-grafana:/configs/grafana - ./secrets/identities/grafana:/source/identities/grafana:ro - ./secrets/identities/reconciler:/source/identities/reconciler:ro - ./secrets/identities/dispatcher:/source/identities/dispatcher:ro - ./secrets/identities/worker:/source/identities/worker:ro - ./secrets/identities/lb:/source/identities/lb:ro - ./secrets/identities/api1:/source/identities/api1:ro - ./secrets/identities/api2:/source/identities/api2:ro - ./secrets/identities/openbao:/source/identities/openbao:ro - ./secrets/identities/db:/source/identities/db:ro - ./secrets/identities/s3:/source/identities/s3:ro - ./secrets/identities/cache:/source/identities/cache:ro - ./secrets/identities/broker:/source/identities/broker:ro - ./secrets/identities/otel-collector:/source/identities/otel-collector:ro - ./secrets/identities/tempo:/source/identities/tempo:ro - ./secrets/identities/loki:/source/identities/loki:ro - ./secrets/identities/prometheus:/source/identities/prometheus:ro security-check: image: mtusi-messenger:lab7 profiles: - operator user: 0:0 read_only: true cap_drop: - ALL cap_add: - DAC_READ_SEARCH security_opt: - no-new-privileges:true mem_limit: 128m cpus: 0.5 pids_limit: 32 healthcheck: disable: true volumes: - ./secrets/identities:/audit-identities:ro - ./secrets/trust:/trust:ro - ./checks:/checks:ro - ./infra/mesh:/mesh:ro command: - python - /checks/tls_matrix.py volumes: grafanadata: null prometheusdata: null lokidata: null tempodata: null pgdata: null s3data: null brokerdata: null baodata: null identity-grafana: {} identity-reconciler: {} identity-dispatcher: {} identity-worker: {} identity-lb: {} identity-api1: {} identity-api2: {} identity-openbao: {} identity-db: {} identity-s3: {} identity-cache: {} identity-broker: {} identity-otel-collector: {} identity-tempo: {} identity-loki: {} identity-prometheus: {} config-s3: {} config-cache: {} config-broker: {} config-grafana: {}