872 lines
21 KiB
YAML
872 lines
21 KiB
YAML
name: mtusi-lab7
|
|
services:
|
|
postgres:
|
|
image: postgres:17.5-bookworm
|
|
environment:
|
|
POSTGRES_DB: messenger
|
|
POSTGRES_USER: messenger
|
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
|
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
|
|
secrets:
|
|
- postgres_password
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./secrets/pki/postgres:/pki:ro
|
|
- ./infra/security/postgres.sh:/config/postgres.sh:ro
|
|
- ./infra/security/pg_hba.conf:/config/pg_hba.conf:ro
|
|
networks:
|
|
- data
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- pg_isready -U messenger -d messenger
|
|
interval: 2s
|
|
timeout: 2s
|
|
retries: 30
|
|
mem_limit: 512m
|
|
cpus: 1.0
|
|
entrypoint:
|
|
- /bin/sh
|
|
- /config/postgres.sh
|
|
command: []
|
|
tmpfs:
|
|
- /tmp:rw,nosuid,size=16m,mode=1777
|
|
- /var/run/postgresql:rw,nosuid,size=16m,mode=3777
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
cap_add:
|
|
- CHOWN
|
|
- SETUID
|
|
- SETGID
|
|
- DAC_OVERRIDE
|
|
- FOWNER
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
redis:
|
|
image: redis:7.4.4-bookworm
|
|
command:
|
|
- redis-server
|
|
- /etc/redis/server.conf
|
|
volumes:
|
|
- redis_data:/data
|
|
- ./infra/security/cache.conf:/etc/redis/server.conf:ro
|
|
- ./secrets/cache.acl:/etc/redis/users.acl:ro
|
|
networks:
|
|
- data
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- redis-cli
|
|
- ping
|
|
interval: 2s
|
|
timeout: 2s
|
|
retries: 30
|
|
mem_limit: 128m
|
|
cpus: 0.25
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
user: 999:999
|
|
migrate:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- sh
|
|
- -c
|
|
- python -m messenger.migrate && python scripts/grant_roles.py
|
|
environment:
|
|
DATABASE_URL_FILE: /run/secrets/database_url
|
|
SSL_CERT_FILE: /trust/ca.crt
|
|
secrets:
|
|
- database_url
|
|
networks:
|
|
- data
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: 'no'
|
|
mem_limit: 256m
|
|
cpus: 0.5
|
|
volumes:
|
|
- ./secrets/trust:/trust:ro
|
|
- ./secrets/operator/db-roles.json:/operator/db-roles.json:ro
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
api:
|
|
image: mtusi-lab7-api:lab7
|
|
build: .
|
|
scale: 2
|
|
environment:
|
|
BAO_ADDR: https://openbao:8200
|
|
TRUST_CA: /trust/ca.crt
|
|
SSL_CERT_FILE: /trust/ca.crt
|
|
AWS_CA_BUNDLE: /trust/ca.crt
|
|
S3_ENDPOINT: https://minio:9000
|
|
S3_REGION: us-east-1
|
|
S3_BUCKET: messenger-attachments
|
|
OTEL_ENABLED: '1'
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: https://collector:4319
|
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
|
BAO_ROLE: api
|
|
POOL_MAX_SIZE: '8'
|
|
JOB_MAX_ATTEMPTS: '5'
|
|
networks:
|
|
- front
|
|
- data
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
redis:
|
|
condition: service_healthy
|
|
minio-init:
|
|
condition: service_completed_successfully
|
|
openbao:
|
|
condition: service_started
|
|
stop_grace_period: 10s
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- python
|
|
- -c
|
|
- import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready',
|
|
timeout=4)
|
|
interval: 2s
|
|
timeout: 5s
|
|
retries: 30
|
|
mem_limit: 512m
|
|
cpus: 1.0
|
|
volumes:
|
|
- ./secrets/pki/api:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=128m,mode=1777
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.secure_api
|
|
minio:
|
|
image: mtusi-lab7-minio:2025-04-22
|
|
build:
|
|
context: .
|
|
dockerfile: infra/minio/Dockerfile
|
|
target: minio
|
|
secrets:
|
|
- minio_root_user
|
|
- minio_root_password
|
|
volumes:
|
|
- minio_data:/data
|
|
- ./secrets/pki/minio/tls.crt:/certs/public.crt:ro
|
|
- ./secrets/pki/minio/tls.key:/certs/private.key:ro
|
|
- ./secrets/trust:/trust:ro
|
|
networks:
|
|
- data
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- python
|
|
- -c
|
|
- import urllib.request;urllib.request.urlopen('https://minio:9000/minio/health/ready',timeout=2)
|
|
interval: 2s
|
|
timeout: 3s
|
|
retries: 30
|
|
stop_grace_period: 10s
|
|
mem_limit: 512m
|
|
cpus: 1.0
|
|
command:
|
|
- server
|
|
- /data
|
|
- --console-address
|
|
- 127.0.0.1:9001
|
|
- --certs-dir
|
|
- /certs
|
|
environment:
|
|
SSL_CERT_FILE: /trust/ca.crt
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
minio-init:
|
|
image: mtusi-lab7-mc:2025-04-16
|
|
build:
|
|
context: .
|
|
dockerfile: infra/minio/Dockerfile
|
|
target: mc
|
|
secrets:
|
|
- minio_root_user
|
|
- minio_root_password
|
|
- s3_api_id
|
|
- s3_api_secret
|
|
- s3_worker_id
|
|
- s3_worker_secret
|
|
- s3_relay_id
|
|
- s3_relay_secret
|
|
- s3_test_id
|
|
- s3_test_secret
|
|
volumes:
|
|
- ./infra/minio/bootstrap.sh:/config/bootstrap.sh:ro
|
|
- ./secrets/policies:/policies:ro
|
|
- ./secrets/trust:/trust:ro
|
|
networks:
|
|
- data
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
restart: 'no'
|
|
user: 10002:10002
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
mem_limit: 128m
|
|
cpus: 0.25
|
|
broker:
|
|
image: redis:7.4.4-bookworm
|
|
command:
|
|
- redis-server
|
|
- /etc/redis/server.conf
|
|
volumes:
|
|
- broker_data:/data
|
|
- ./infra/security/broker.conf:/etc/redis/server.conf:ro
|
|
- ./secrets/broker.acl:/etc/redis/users.acl:ro
|
|
networks:
|
|
- data
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- redis-cli
|
|
- ping
|
|
interval: 2s
|
|
timeout: 2s
|
|
retries: 30
|
|
mem_limit: 160m
|
|
cpus: 0.5
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
user: 999:999
|
|
worker:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.worker
|
|
- worker
|
|
environment:
|
|
BAO_ADDR: https://openbao:8200
|
|
TRUST_CA: /trust/ca.crt
|
|
SSL_CERT_FILE: /trust/ca.crt
|
|
AWS_CA_BUNDLE: /trust/ca.crt
|
|
S3_ENDPOINT: https://minio:9000
|
|
S3_REGION: us-east-1
|
|
S3_BUCKET: messenger-attachments
|
|
OTEL_ENABLED: '1'
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: https://collector:4319
|
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
|
BAO_ROLE: worker
|
|
POOL_MAX_SIZE: '8'
|
|
JOB_MAX_ATTEMPTS: '5'
|
|
networks: &id001
|
|
- data
|
|
depends_on: &id002
|
|
broker:
|
|
condition: service_healthy
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
minio-init:
|
|
condition: service_completed_successfully
|
|
openbao:
|
|
condition: service_started
|
|
stop_grace_period: 45s
|
|
restart: unless-stopped
|
|
mem_limit: 512m
|
|
cpus: 1.0
|
|
volumes:
|
|
- ./secrets/pki/worker:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=128m,mode=1777
|
|
relay:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.worker
|
|
- relay
|
|
environment:
|
|
BAO_ADDR: https://openbao:8200
|
|
TRUST_CA: /trust/ca.crt
|
|
SSL_CERT_FILE: /trust/ca.crt
|
|
AWS_CA_BUNDLE: /trust/ca.crt
|
|
S3_ENDPOINT: https://minio:9000
|
|
S3_REGION: us-east-1
|
|
S3_BUCKET: messenger-attachments
|
|
OTEL_ENABLED: '1'
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: https://collector:4319
|
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
|
BAO_ROLE: relay
|
|
POOL_MAX_SIZE: '8'
|
|
JOB_MAX_ATTEMPTS: '5'
|
|
networks: *id001
|
|
depends_on: *id002
|
|
stop_grace_period: 45s
|
|
restart: unless-stopped
|
|
mem_limit: 192m
|
|
cpus: 0.25
|
|
volumes:
|
|
- ./secrets/pki/relay:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=128m,mode=1777
|
|
lb:
|
|
image: nginx:1.28.0-alpine
|
|
volumes:
|
|
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./secrets/pki/lb:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
networks:
|
|
- front
|
|
ports:
|
|
- 127.0.0.1:8443:8443
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- curl
|
|
- -fsS
|
|
- --cacert
|
|
- /trust/ca.crt
|
|
- https://localhost:8443/health/ready
|
|
interval: 1s
|
|
timeout: 8s
|
|
retries: 30
|
|
mem_limit: 128m
|
|
cpus: 0.5
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,nosuid,size=128m,mode=1777
|
|
- /var/cache/nginx:rw,nosuid,size=128m,mode=1777
|
|
- /var/run:rw,nosuid,size=16m,mode=1777
|
|
user: 101:101
|
|
collector:
|
|
image: otel/opentelemetry-collector-contrib:0.128.0
|
|
command:
|
|
- --config=/etc/otelcol/config.yaml
|
|
volumes:
|
|
- ./infra/observability/collector.yaml:/etc/otelcol/config.yaml:ro
|
|
- ./secrets/pki/collector:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
networks:
|
|
- data
|
|
- observe
|
|
mem_limit: 256m
|
|
cpus: 0.5
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
prometheus:
|
|
image: prom/prometheus:v3.4.1
|
|
command:
|
|
- --config.file=/etc/prometheus/prometheus.yaml
|
|
- --storage.tsdb.retention.time=7d
|
|
- --web.listen-address=127.0.0.1:9090
|
|
volumes:
|
|
- ./infra/observability/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
|
|
- ./infra/observability/alerts.yaml:/etc/prometheus/alerts.yaml:ro
|
|
- prometheus_data:/prometheus
|
|
- ./secrets/pki/prometheus:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
ports:
|
|
- 127.0.0.1:9090:9443
|
|
networks:
|
|
- observe
|
|
- admin
|
|
mem_limit: 512m
|
|
cpus: 0.5
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
loki:
|
|
image: grafana/loki:3.5.1
|
|
command:
|
|
- -config.file=/etc/loki/local.yaml
|
|
volumes:
|
|
- ./infra/observability/loki.yaml:/etc/loki/local.yaml:ro
|
|
- loki_data:/loki
|
|
networks:
|
|
- observe
|
|
- admin
|
|
ports:
|
|
- 127.0.0.1:3100:9443
|
|
mem_limit: 384m
|
|
cpus: 0.5
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
tempo:
|
|
image: grafana/tempo:2.7.2
|
|
command:
|
|
- -config.file=/etc/tempo/local.yaml
|
|
user: 10001:10001
|
|
volumes:
|
|
- ./infra/observability/tempo.yaml:/etc/tempo/local.yaml:ro
|
|
- tempo_data:/var/tempo
|
|
networks:
|
|
- observe
|
|
- admin
|
|
ports:
|
|
- 127.0.0.1:3200:9443
|
|
mem_limit: 512m
|
|
cpus: 1.0
|
|
environment:
|
|
GOMEMLIMIT: 384MiB
|
|
restart: unless-stopped
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
depends_on:
|
|
volume-init:
|
|
condition: service_completed_successfully
|
|
grafana:
|
|
image: grafana/grafana:12.0.1
|
|
environment:
|
|
GF_SECURITY_ADMIN_USER: operator
|
|
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_password
|
|
GF_USERS_ALLOW_SIGN_UP: 'false'
|
|
GF_ANALYTICS_REPORTING_ENABLED: 'false'
|
|
GF_SERVER_PROTOCOL: https
|
|
GF_SERVER_CERT_FILE: /pki/tls.crt
|
|
GF_SERVER_CERT_KEY: /pki/tls.key
|
|
GF_SERVER_ROOT_URL: https://localhost:3000
|
|
secrets:
|
|
- grafana_password
|
|
volumes:
|
|
- ./infra/observability/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
|
|
- ./secrets/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/local.yaml:ro
|
|
- ./infra/observability/grafana/dashboards:/var/lib/grafana/dashboards:ro
|
|
- grafana_data:/var/lib/grafana
|
|
- ./secrets/pki/grafana:/pki:ro
|
|
ports:
|
|
- 127.0.0.1:3000:3000
|
|
networks:
|
|
- observe
|
|
- admin
|
|
mem_limit: 256m
|
|
cpus: 0.5
|
|
read_only: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
broker-tls:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.tls_gateway
|
|
network_mode: service:broker
|
|
depends_on:
|
|
broker:
|
|
condition: service_started
|
|
restart: true
|
|
volumes:
|
|
- ./infra/security/broker-gateway.json:/etc/gateway.json:ro
|
|
- ./secrets/pki/broker:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
|
|
mem_limit: 96m
|
|
cpus: 0.25
|
|
restart: unless-stopped
|
|
redis-tls:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.tls_gateway
|
|
network_mode: service:redis
|
|
depends_on:
|
|
redis:
|
|
condition: service_started
|
|
restart: true
|
|
volumes:
|
|
- ./infra/security/redis-gateway.json:/etc/gateway.json:ro
|
|
- ./secrets/pki/redis:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
|
|
mem_limit: 96m
|
|
cpus: 0.25
|
|
restart: unless-stopped
|
|
collector-tls:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.tls_gateway
|
|
network_mode: service:collector
|
|
depends_on:
|
|
collector:
|
|
condition: service_started
|
|
restart: true
|
|
volumes:
|
|
- ./infra/security/collector-gateway.json:/etc/gateway.json:ro
|
|
- ./secrets/pki/collector:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
|
|
mem_limit: 96m
|
|
cpus: 0.25
|
|
restart: unless-stopped
|
|
prometheus-tls:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.tls_gateway
|
|
network_mode: service:prometheus
|
|
depends_on:
|
|
prometheus:
|
|
condition: service_started
|
|
restart: true
|
|
volumes:
|
|
- ./infra/security/prometheus-gateway.json:/etc/gateway.json:ro
|
|
- ./secrets/pki/prometheus:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
|
|
mem_limit: 96m
|
|
cpus: 0.25
|
|
restart: unless-stopped
|
|
loki-tls:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.tls_gateway
|
|
network_mode: service:loki
|
|
depends_on:
|
|
loki:
|
|
condition: service_started
|
|
restart: true
|
|
volumes:
|
|
- ./infra/security/loki-gateway.json:/etc/gateway.json:ro
|
|
- ./secrets/pki/loki:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
|
|
mem_limit: 96m
|
|
cpus: 0.25
|
|
restart: unless-stopped
|
|
tempo-tls:
|
|
image: mtusi-lab7-api:lab7
|
|
command:
|
|
- python
|
|
- -m
|
|
- messenger.tls_gateway
|
|
network_mode: service:tempo
|
|
depends_on:
|
|
tempo:
|
|
condition: service_started
|
|
restart: true
|
|
volumes:
|
|
- ./infra/security/tempo-gateway.json:/etc/gateway.json:ro
|
|
- ./secrets/pki/tempo:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
read_only: true
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
|
|
mem_limit: 96m
|
|
cpus: 0.25
|
|
restart: unless-stopped
|
|
openbao:
|
|
image: openbao/openbao:2.2.2
|
|
command:
|
|
- server
|
|
- -config=/openbao/config/server.hcl
|
|
volumes:
|
|
- ./infra/security/openbao.hcl:/openbao/config/server.hcl:ro
|
|
- ./secrets/pki/openbao:/pki:ro
|
|
- ./secrets/trust:/trust:ro
|
|
- bao_data:/openbao/file
|
|
networks:
|
|
- data
|
|
- admin
|
|
ports:
|
|
- 127.0.0.1:8200:8200
|
|
mem_limit: 256m
|
|
cpus: 0.5
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
environment:
|
|
SKIP_SETCAP: 'true'
|
|
SKIP_CHOWN: 'true'
|
|
user: 100:1000
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=32m,mode=1777
|
|
depends_on:
|
|
volume-init:
|
|
condition: service_completed_successfully
|
|
student-tests:
|
|
image: mtusi-lab7-api:lab7
|
|
profiles:
|
|
- tests
|
|
command:
|
|
- python
|
|
- -m
|
|
- pytest
|
|
- student-tests
|
|
- -q
|
|
- -o
|
|
- cache_dir=/tmp/pytest-cache
|
|
environment:
|
|
DATABASE_URL_FILE: /run/secrets/database_url
|
|
S3_ENDPOINT: https://minio:9000
|
|
S3_REGION: us-east-1
|
|
S3_BUCKET: messenger-attachments
|
|
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_test_id
|
|
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_test_secret
|
|
OTEL_ENABLED: '0'
|
|
SSL_CERT_FILE: /trust/ca.crt
|
|
AWS_CA_BUNDLE: /trust/ca.crt
|
|
CACHE_URL_FILE: /run/secrets/test_cache_url
|
|
secrets:
|
|
- database_url
|
|
- s3_test_id
|
|
- s3_test_secret
|
|
- test_cache_url
|
|
volumes:
|
|
- ./secrets/trust:/trust:ro
|
|
- ./secrets/trust:/security-tests/trust:ro
|
|
- ./secrets/pki/api:/security-tests/pki/api:ro
|
|
- ./secrets/pki/lb:/security-tests/pki/lb:ro
|
|
- ./secrets/pki/grafana:/security-tests/pki/grafana:ro
|
|
- ./secrets/pki/intruder:/security-tests/pki/intruder:ro
|
|
- ./secrets/operator/foreign/leaf:/security-tests/operator/foreign/leaf:ro
|
|
- ./secrets/pki/operator:/pki:ro
|
|
networks:
|
|
- data
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:rw,nosuid,size=128m,mode=1777
|
|
cap_drop:
|
|
- ALL
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
mem_limit: 512m
|
|
cpus: 1
|
|
volume-init:
|
|
image: python:3.13.5-slim
|
|
user: 0:0
|
|
command:
|
|
- python
|
|
- -c
|
|
- import os;os.chown('/tempo',10001,10001);os.chown('/bao',100,1000)
|
|
volumes:
|
|
- tempo_data:/tempo
|
|
- bao_data:/bao
|
|
networks:
|
|
- data
|
|
cap_drop:
|
|
- ALL
|
|
cap_add:
|
|
- CHOWN
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
read_only: true
|
|
mem_limit: 64m
|
|
cpus: 0.25
|
|
security-audit:
|
|
image: mtusi-lab7-api:lab7
|
|
profiles:
|
|
- operator
|
|
command:
|
|
- python
|
|
- /audit-scripts/matrix_audit.py
|
|
volumes:
|
|
- ./scripts:/audit-scripts:ro
|
|
- ./secrets/trust:/trust:ro
|
|
- ./secrets/operator/workloads.json:/operator/workloads.json:ro
|
|
- ./secrets/operator/foreign/leaf:/foreign:ro
|
|
- ./secrets/pki/api:/identities/api:ro
|
|
- ./secrets/pki/lb:/identities/lb:ro
|
|
- ./secrets/pki/worker:/identities/worker:ro
|
|
- ./secrets/pki/relay:/identities/relay:ro
|
|
- ./secrets/pki/broker:/identities/broker:ro
|
|
- ./secrets/pki/redis:/identities/redis:ro
|
|
- ./secrets/pki/collector:/identities/collector:ro
|
|
- ./secrets/pki/prometheus:/identities/prometheus:ro
|
|
- ./secrets/pki/loki:/identities/loki:ro
|
|
- ./secrets/pki/tempo:/identities/tempo:ro
|
|
- ./secrets/pki/grafana:/identities/grafana:ro
|
|
- ./secrets/pki/operator:/identities/operator:ro
|
|
- ./secrets/pki/intruder:/identities/intruder:ro
|
|
networks:
|
|
- front
|
|
- data
|
|
- observe
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop:
|
|
- ALL
|
|
mem_limit: 256m
|
|
cpus: 0.5
|
|
secrets:
|
|
- database_url
|
|
- s3_test_id
|
|
- s3_test_secret
|
|
environment:
|
|
DATABASE_URL_FILE: /run/secrets/database_url
|
|
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_test_id
|
|
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_test_secret
|
|
S3_ENDPOINT: https://minio:9000
|
|
S3_REGION: us-east-1
|
|
S3_BUCKET: messenger-attachments
|
|
AWS_CA_BUNDLE: /trust/ca.crt
|
|
SSL_CERT_FILE: /trust/ca.crt
|
|
OTEL_ENABLED: '0'
|
|
networks:
|
|
admin: null
|
|
observe:
|
|
internal: true
|
|
front: null
|
|
data:
|
|
internal: true
|
|
secrets:
|
|
grafana_password:
|
|
file: ./secrets/grafana_password
|
|
postgres_password:
|
|
file: ./secrets/postgres_password
|
|
database_url:
|
|
file: ./secrets/database_url
|
|
cache_url:
|
|
file: ./secrets/cache_url
|
|
minio_root_user:
|
|
file: ./secrets/minio_root_user
|
|
minio_root_password:
|
|
file: ./secrets/minio_root_password
|
|
s3_access_key_id:
|
|
file: ./secrets/s3_access_key_id
|
|
s3_secret_access_key:
|
|
file: ./secrets/s3_secret_access_key
|
|
s3_api_id:
|
|
file: ./secrets/s3_api_id
|
|
s3_api_secret:
|
|
file: ./secrets/s3_api_secret
|
|
s3_worker_id:
|
|
file: ./secrets/s3_worker_id
|
|
s3_worker_secret:
|
|
file: ./secrets/s3_worker_secret
|
|
s3_relay_id:
|
|
file: ./secrets/s3_relay_id
|
|
s3_relay_secret:
|
|
file: ./secrets/s3_relay_secret
|
|
s3_test_id:
|
|
file: ./secrets/s3_test_id
|
|
s3_test_secret:
|
|
file: ./secrets/s3_test_secret
|
|
test_cache_url:
|
|
file: ./secrets/test_cache_url
|
|
volumes:
|
|
postgres_data: null
|
|
redis_data: null
|
|
minio_data: null
|
|
broker_data: null
|
|
prometheus_data: null
|
|
loki_data: null
|
|
tempo_data: null
|
|
grafana_data: null
|
|
bao_data: {}
|