forked from mtusi2026/mtusi2026lab7
feat: complete lab 7 for grade 4
This commit is contained in:
+883
@@ -0,0 +1,883 @@
|
||||
name: mtusi2026lab7
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16.16-bookworm@sha256:cd0e9518bda5f2ea667ff84d22795d089720c883f288e215d97ce57437e8ef37
|
||||
networks:
|
||||
- db
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/postgres:/run/identity:ro
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./infra/postgres:/lab:ro
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
environment:
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_PASSWORD_FILE: /run/identity/admin
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /lab/start.sh
|
||||
tmpfs:
|
||||
- /run/postgres-tls
|
||||
- /tmp
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- pg_isready -h 127.0.0.1 -d messenger -U migrator
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 25
|
||||
start_period: 10s
|
||||
s3:
|
||||
image: bitnamilegacy/minio:2025.7.23-debian-12-r5@sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20
|
||||
networks:
|
||||
- objects
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/s3:/run/identity:ro
|
||||
- s3_data:/data
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
entrypoint:
|
||||
- /opt/bitnami/minio/bin/minio
|
||||
command:
|
||||
- server
|
||||
- /data
|
||||
- --certs-dir
|
||||
- /run/identity
|
||||
- --console-address
|
||||
- :9001
|
||||
environment:
|
||||
MINIO_ROOT_USER: labroot
|
||||
MINIO_ROOT_PASSWORD_FILE: /run/identity/admin
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- curl
|
||||
- -fsS
|
||||
- --cacert
|
||||
- /run/trust/ca.crt
|
||||
- --resolve
|
||||
- s3:9000:127.0.0.1
|
||||
- https://s3:9000/minio/health/live
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 25
|
||||
start_period: 10s
|
||||
user: 1001:0
|
||||
depends_on:
|
||||
volume-init:
|
||||
condition: service_completed_successfully
|
||||
s3-bootstrap:
|
||||
user: 1001:0
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: bitnamilegacy/minio:2025.7.23-debian-12-r5@sha256:6dabb4a2088c9a79908de3bc05f4586c23ad2182c8908e7e3acbf61c1467fb20
|
||||
networks:
|
||||
- objects
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/s3:/run/identity:ro
|
||||
- ./infra/minio:/lab:ro
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /lab/bootstrap.sh
|
||||
depends_on:
|
||||
s3:
|
||||
condition: service_healthy
|
||||
profiles:
|
||||
- bootstrap
|
||||
broker:
|
||||
image: rabbitmq:4.1.8-management@sha256:8699e1329a59f86824f92d0fbb74d2ff8bc86e1a190d3e165cceb0f22e21bbb0
|
||||
networks:
|
||||
- queue
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/broker:/run/identity:ro
|
||||
- broker_data:/var/lib/rabbitmq
|
||||
- ./infra/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
|
||||
- ./infra/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
||||
- ./infra/rabbitmq:/lab:ro
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
hostname: broker
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- rabbitmq-diagnostics
|
||||
- -q
|
||||
- check_running
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 25
|
||||
start_period: 20s
|
||||
openbao:
|
||||
image: ghcr.io/openbao/openbao:2.7.3
|
||||
networks:
|
||||
- secrets
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/openbao:/run/identity:ro
|
||||
- openbao_data_v2:/openbao/data
|
||||
- ./infra/openbao:/lab:ro
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
entrypoint:
|
||||
- bao
|
||||
command:
|
||||
- server
|
||||
- -config=/lab/server.hcl
|
||||
ports:
|
||||
- 127.0.0.1:18200:8200
|
||||
environment:
|
||||
BAO_ADDR: https://localhost:8200
|
||||
BAO_CACERT: /run/trust/ca.crt
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- bao
|
||||
- status
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 25
|
||||
start_period: 10s
|
||||
cap_drop:
|
||||
- ALL
|
||||
user: "100:1000"
|
||||
depends_on:
|
||||
volume-init:
|
||||
condition: service_completed_successfully
|
||||
migrate:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 256m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
build: .
|
||||
networks:
|
||||
- db
|
||||
environment:
|
||||
DATABASE_URL_FILE: /run/identity/dsn
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/migrator:/run/identity:ro
|
||||
command:
|
||||
- python
|
||||
- -m
|
||||
- src.migrate
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
ops:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 256m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
networks:
|
||||
- db
|
||||
- queue
|
||||
profiles:
|
||||
- ops
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/ops:/run/identity:ro
|
||||
environment:
|
||||
DATABASE_URL_FILE: /run/identity/dsn
|
||||
TLS_CA_FILE: /run/trust/ca.crt
|
||||
entrypoint:
|
||||
- python
|
||||
- -m
|
||||
- src.operator
|
||||
api-a:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 768m
|
||||
cpus: 1.0
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
networks:
|
||||
- db
|
||||
- objects
|
||||
- secrets
|
||||
- otlp
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/api-a:/run/identity:ro
|
||||
- api-a_socket:/run/api
|
||||
environment:
|
||||
TLS_CA_FILE: /run/trust/ca.crt
|
||||
BAO_ADDR: https://openbao:8200
|
||||
BAO_ROLE: api-a
|
||||
CREDENTIAL_MAX_AGE: ${CREDENTIAL_MAX_AGE:-30}
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_CERTIFICATE: /run/trust/ca.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /run/identity/otel.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_KEY: /run/identity/otel.key
|
||||
PIPELINE_FAULTS: ${PIPELINE_FAULTS:-0}
|
||||
BAO_SCOPE: api
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
LOGIN_WINDOW_LIMIT: ${LOGIN_WINDOW_LIMIT:-40}
|
||||
LOGIN_WINDOW_SECONDS: ${LOGIN_WINDOW_SECONDS:-10}
|
||||
ARGON2_MEMORY_KIB: ${ARGON2_MEMORY_KIB:-65536}
|
||||
ARGON2_ITERATIONS: ${ARGON2_ITERATIONS:-3}
|
||||
ARGON2_PARALLELISM: ${ARGON2_PARALLELISM:-4}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
s3:
|
||||
condition: service_healthy
|
||||
openbao:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- /app/uds_probe.py
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 25
|
||||
start_period: 10s
|
||||
api-a-tls:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: haproxy:3.0.32-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
|
||||
command: ["haproxy", "-W", "-db", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/api-a-tls:/run/identity:ro
|
||||
- ./infra/tls/api.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
||||
- api-a_socket:/run/api
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- edge
|
||||
api-b:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 768m
|
||||
cpus: 1.0
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
networks:
|
||||
- db
|
||||
- objects
|
||||
- secrets
|
||||
- otlp
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/api-b:/run/identity:ro
|
||||
- api-b_socket:/run/api
|
||||
environment:
|
||||
TLS_CA_FILE: /run/trust/ca.crt
|
||||
BAO_ADDR: https://openbao:8200
|
||||
BAO_ROLE: api-b
|
||||
CREDENTIAL_MAX_AGE: ${CREDENTIAL_MAX_AGE:-30}
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_CERTIFICATE: /run/trust/ca.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /run/identity/otel.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_KEY: /run/identity/otel.key
|
||||
PIPELINE_FAULTS: ${PIPELINE_FAULTS:-0}
|
||||
BAO_SCOPE: api
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
LOGIN_WINDOW_LIMIT: ${LOGIN_WINDOW_LIMIT:-40}
|
||||
LOGIN_WINDOW_SECONDS: ${LOGIN_WINDOW_SECONDS:-10}
|
||||
ARGON2_MEMORY_KIB: ${ARGON2_MEMORY_KIB:-65536}
|
||||
ARGON2_ITERATIONS: ${ARGON2_ITERATIONS:-3}
|
||||
ARGON2_PARALLELISM: ${ARGON2_PARALLELISM:-4}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
s3:
|
||||
condition: service_healthy
|
||||
openbao:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- /app/uds_probe.py
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 25
|
||||
start_period: 10s
|
||||
api-b-tls:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: haproxy:3.0.32-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
|
||||
command: ["haproxy", "-W", "-db", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/api-b-tls:/run/identity:ro
|
||||
- ./infra/tls/api.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
||||
- api-b_socket:/run/api
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- edge
|
||||
publisher:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 384m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
networks:
|
||||
- db
|
||||
- queue
|
||||
- secrets
|
||||
- otlp
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/publisher:/run/identity:ro
|
||||
environment:
|
||||
TLS_CA_FILE: /run/trust/ca.crt
|
||||
BAO_ADDR: https://openbao:8200
|
||||
BAO_ROLE: publisher
|
||||
CREDENTIAL_MAX_AGE: ${CREDENTIAL_MAX_AGE:-30}
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_CERTIFICATE: /run/trust/ca.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /run/identity/otel.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_KEY: /run/identity/otel.key
|
||||
PIPELINE_FAULTS: ${PIPELINE_FAULTS:-0}
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- python
|
||||
- -m
|
||||
- src.publisher
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- -m
|
||||
- src.pipeline_health
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 5
|
||||
start_period: 25s
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
openbao:
|
||||
condition: service_healthy
|
||||
worker:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 768m
|
||||
cpus: 1.0
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=64m,mode=1777
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
networks:
|
||||
- db
|
||||
- objects
|
||||
- queue
|
||||
- secrets
|
||||
- otlp
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/worker:/run/identity:ro
|
||||
environment:
|
||||
TLS_CA_FILE: /run/trust/ca.crt
|
||||
BAO_ADDR: https://openbao:8200
|
||||
BAO_ROLE: worker
|
||||
CREDENTIAL_MAX_AGE: ${CREDENTIAL_MAX_AGE:-30}
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_CERTIFICATE: /run/trust/ca.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /run/identity/otel.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_KEY: /run/identity/otel.key
|
||||
PIPELINE_FAULTS: ${PIPELINE_FAULTS:-0}
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- python
|
||||
- -m
|
||||
- src.worker
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- -m
|
||||
- src.pipeline_health
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 5
|
||||
start_period: 25s
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
openbao:
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
replicas: 2
|
||||
init: true
|
||||
stop_grace_period: 30s
|
||||
recovery:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 384m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
networks:
|
||||
- db
|
||||
- objects
|
||||
- secrets
|
||||
- otlp
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/recovery:/run/identity:ro
|
||||
environment:
|
||||
TLS_CA_FILE: /run/trust/ca.crt
|
||||
BAO_ADDR: https://openbao:8200
|
||||
BAO_ROLE: recovery
|
||||
CREDENTIAL_MAX_AGE: ${CREDENTIAL_MAX_AGE:-30}
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
OTEL_EXPORTER_OTLP_CERTIFICATE: /run/trust/ca.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: /run/identity/otel.crt
|
||||
OTEL_EXPORTER_OTLP_CLIENT_KEY: /run/identity/otel.key
|
||||
PIPELINE_FAULTS: ${PIPELINE_FAULTS:-0}
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- python
|
||||
- -m
|
||||
- src.recovery
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- python
|
||||
- -m
|
||||
- src.pipeline_health
|
||||
interval: 3s
|
||||
timeout: 4s
|
||||
retries: 25
|
||||
start_period: 25s
|
||||
depends_on:
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
openbao:
|
||||
condition: service_healthy
|
||||
lb:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: haproxy:3.0.32-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
|
||||
command: ["haproxy", "-W", "-db", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/lb:/run/identity:ro
|
||||
- ./infra/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- edge
|
||||
- telemetry
|
||||
ports:
|
||||
- 127.0.0.1:8443:8443
|
||||
otel-collector:
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-otel:local
|
||||
networks:
|
||||
- otlp
|
||||
- telemetry
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/otel:/run/identity:ro
|
||||
- ./infra/otel/collector.yaml:/etc/otel/collector.yaml:ro
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 256m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
build:
|
||||
context: ./infra/otel
|
||||
target: collector
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
cap_drop:
|
||||
- ALL
|
||||
command:
|
||||
- --config=/etc/otel/collector.yaml
|
||||
otel-tls:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: haproxy:3.0.32-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/otel:/run/identity:ro
|
||||
- ./infra/tls/otel.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
||||
restart: unless-stopped
|
||||
network_mode: service:otel-collector
|
||||
prometheus:
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-prometheus:local
|
||||
networks:
|
||||
- telemetry
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/prometheus:/run/identity:ro
|
||||
- ./infra/prometheus:/etc/prometheus:ro
|
||||
- prometheus_data:/prometheus
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
build:
|
||||
context: ./infra/otel
|
||||
target: prometheus
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
cap_drop:
|
||||
- ALL
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yaml
|
||||
- --web.listen-address=127.0.0.1:19090
|
||||
- --storage.tsdb.path=/prometheus
|
||||
- --storage.tsdb.retention.time=3d
|
||||
- --storage.tsdb.retention.size=512MB
|
||||
- --enable-feature=exemplar-storage
|
||||
prometheus-tls:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: haproxy:3.0.32-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/prometheus:/run/identity:ro
|
||||
- ./infra/tls/prometheus.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
||||
restart: unless-stopped
|
||||
network_mode: service:prometheus
|
||||
loki:
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-loki:local
|
||||
networks:
|
||||
- telemetry
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/loki:/run/identity:ro
|
||||
- ./infra/loki/loki.yaml:/etc/loki/loki.yaml:ro
|
||||
- loki_data:/loki
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
build:
|
||||
context: ./infra/otel
|
||||
target: loki
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
cap_drop:
|
||||
- ALL
|
||||
command:
|
||||
- -config.file=/etc/loki/loki.yaml
|
||||
loki-tls:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: haproxy:3.0.32-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/loki:/run/identity:ro
|
||||
- ./infra/tls/loki.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
||||
restart: unless-stopped
|
||||
network_mode: service:loki
|
||||
tempo:
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-tempo:local
|
||||
networks:
|
||||
- telemetry
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/tempo:/run/identity:ro
|
||||
- ./infra/tempo/tempo.yaml:/etc/tempo/tempo.yaml:ro
|
||||
- tempo_data:/var/tempo
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
build:
|
||||
context: ./infra/otel
|
||||
target: tempo
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
cap_drop:
|
||||
- ALL
|
||||
command:
|
||||
- -config.file=/etc/tempo/tempo.yaml
|
||||
tempo-tls:
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- ALL
|
||||
mem_limit: 128m
|
||||
cpus: 0.5
|
||||
pids_limit: 128
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
image: haproxy:3.0.32-alpine@sha256:457d1c0dcbf2dfc0e0358723c07df4410d30e7de42bec036b383cfede4a5dbe3
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/tempo:/run/identity:ro
|
||||
- ./infra/tls/tempo.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
||||
restart: unless-stopped
|
||||
network_mode: service:tempo
|
||||
grafana:
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-grafana:local
|
||||
networks:
|
||||
- telemetry
|
||||
volumes:
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE:?run scripts/compose.sh}/grafana:/run/identity:ro
|
||||
- grafana_data:/var/lib/grafana
|
||||
- ./scripts/grafana-start.sh:/lab/grafana-start.sh:ro
|
||||
- ./infra/grafana/provisioning:/etc/grafana/provisioning:ro
|
||||
- ./infra/grafana/dashboards:/var/lib/grafana/dashboards:ro
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
mem_limit: 512m
|
||||
cpus: 0.75
|
||||
pids_limit: 256
|
||||
build:
|
||||
context: ./infra/otel
|
||||
target: grafana
|
||||
read_only: true
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
cap_drop:
|
||||
- ALL
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /lab/grafana-start.sh
|
||||
ports:
|
||||
- 127.0.0.1:3007:3000
|
||||
environment:
|
||||
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/identity/admin
|
||||
GF_SERVER_PROTOCOL: https
|
||||
GF_SERVER_CERT_FILE: /run/identity/server.crt
|
||||
GF_SERVER_CERT_KEY: /run/identity/server.key
|
||||
GF_SERVER_ROOT_URL: https://localhost:3007
|
||||
GF_USERS_ALLOW_SIGN_UP: 'false'
|
||||
GF_ANALYTICS_REPORTING_ENABLED: 'false'
|
||||
GF_ANALYTICS_CHECK_FOR_UPDATES: 'false'
|
||||
volume-init:
|
||||
image: busybox:1.37.0-musl
|
||||
network_mode: none
|
||||
user: 0:0
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- -ec
|
||||
- |
|
||||
chown 100:1000 /bao
|
||||
chown 1001:0 /s3
|
||||
read_only: true
|
||||
cap_drop:
|
||||
- ALL
|
||||
cap_add:
|
||||
- CHOWN
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
volumes:
|
||||
- openbao_data_v2:/bao
|
||||
- s3_data:/s3
|
||||
mem_limit: 32m
|
||||
cpus: 0.2
|
||||
pids_limit: 16
|
||||
probe:
|
||||
image: ${LAB7_IMAGE_PREFIX:-mtusi2026lab7}-app:local
|
||||
profiles:
|
||||
- operator
|
||||
networks:
|
||||
- edge
|
||||
- queue
|
||||
- otlp
|
||||
- db
|
||||
- objects
|
||||
- secrets
|
||||
- telemetry
|
||||
user: 10001:10001
|
||||
read_only: true
|
||||
cap_drop:
|
||||
- ALL
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
pids_limit: 32
|
||||
mem_limit: 96m
|
||||
cpus: 0.5
|
||||
entrypoint:
|
||||
- python
|
||||
- /lab/probe.py
|
||||
volumes:
|
||||
- ./student-tests/tls_probe.py:/lab/probe.py:ro
|
||||
- ${LAB7_STATE}/trust:/run/trust:ro
|
||||
- ${LAB7_STATE}/lb:/probe/lb:ro
|
||||
- ${LAB7_STATE}/probe:/probe/probe:ro
|
||||
- ${LAB7_STATE}/publisher:/probe/publisher:ro
|
||||
- ${LAB7_STATE}/worker:/probe/worker:ro
|
||||
- ${LAB7_STATE}/ops:/probe/ops:ro
|
||||
- ${LAB7_STATE}/rotation:/probe/rotation:ro
|
||||
- ${LAB7_STATE}/api-a:/probe/api-a:ro
|
||||
- ${LAB7_STATE}/api-b:/probe/api-b:ro
|
||||
- ${LAB7_STATE}/recovery:/probe/recovery:ro
|
||||
- ${LAB7_STATE}/otel:/probe/otel:ro
|
||||
- ${LAB7_STATE}/grafana:/probe/grafana:ro
|
||||
- ${LAB7_STATE}/prometheus:/probe/prometheus:ro
|
||||
volumes:
|
||||
postgres_data: {}
|
||||
s3_data: {}
|
||||
broker_data: {}
|
||||
openbao_data_v2: {}
|
||||
api-a_socket:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: tmpfs
|
||||
device: tmpfs
|
||||
o: uid=10001,gid=10001,mode=0750,size=1048576
|
||||
api-b_socket:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: tmpfs
|
||||
device: tmpfs
|
||||
o: uid=10001,gid=10001,mode=0750,size=1048576
|
||||
prometheus_data: {}
|
||||
loki_data: {}
|
||||
tempo_data: {}
|
||||
grafana_data: {}
|
||||
networks:
|
||||
edge: {}
|
||||
db: {}
|
||||
objects: {}
|
||||
queue: {}
|
||||
secrets: {}
|
||||
otlp: {}
|
||||
telemetry: {}
|
||||
Reference in New Issue
Block a user