python student-tests/check_stack.py
docker:  29.6.2
compose: 5.3.1
container_name: not set for any service (replicas of one service are possible)
api replicas running: 2 -> ['b0db3e40abfe', 'ef44b0d4c0a1'] (deploy.replicas = 2)

service        container      cpus   memory  published ports                    networks
valkey         4e223cb9301e   0.50    128Mi  -                                  backend
s3             892c7ca290f2   0.50    512Mi  -                                  backend
lb             8be67a2e86b7   0.50    128Mi  127.0.0.1:8080->8080/tcp, 127.0.0.1:8081->8081/tcp, 127.0.0.1:8404->8404/tcp edge
broker         9f909ed7ecea   1.00    512Mi  -                                  backend
api            b0db3e40abfe   1.00    512Mi  -                                  backend, edge
postgres       d2bfd48385f1   1.00    512Mi  -                                  backend
worker         d9eced386d93   1.00   1024Mi  -                                  backend
api            ef44b0d4c0a1   1.00    512Mi  -                                  backend, edge

published: only lb, only on 127.0.0.1 (api replicas have no ports)
balancer: every api server is under the /health/ready check, no backup servers -> api1 UP (L7OK), api2 UP (L7OK)
limits: every running container has CPU and RAM limits
networks: lb -> edge; api -> edge + backend; postgres, valkey, s3, broker, worker -> backend (internal: no way out)
broker: rabbitmq:4.2.9-alpine, volume rabbitmqdata, hostname broker, no ports, no web console; worker: separate service (1 running), no ports
s3: no published ports; master/filer web UIs only on 127.0.0.1 inside the container; IAM API off; pinned image; volume s3data
secrets: api -> broker_url, cache_url, database_url, s3_access_key_id, s3_secret_access_key; worker -> broker_url, database_url, s3_access_key_id, s3_secret_access_key; broker -> broker_credentials; migrate -> database_url; lb -> none; postgres -> postgres_password; valkey -> valkey_acl; s3 -> s3_config; s3-init -> s3_root_password, s3_root_user
images:  lb haproxy:3.2.25-alpine; api mtusi-messenger:lab5; worker mtusi-messenger:lab5; postgres postgres:17.10-bookworm; valkey valkey/valkey:8.1.9; s3 chrislusf/seaweedfs:4.44; broker rabbitmq:4.2.9-alpine
PASS: one entry point (lb on 127.0.0.1), >= 2 api replicas without ports and container_name, only ready replicas get traffic, CPU/RAM limits everywhere, stores (incl. S3) only on the internal network, S3 admin credentials only in s3-init; broker and worker are separate services
docker compose ps -a --format "table {{.Service}}\t{{.ID}}\t{{.Status}}"
SERVICE    CONTAINER ID   STATUS
api        b0db3e40abfe   Up 34 seconds (healthy)
api        ef44b0d4c0a1   Up 34 seconds (healthy)
broker     9f909ed7ecea   Up 43 seconds (healthy)
lb         8be67a2e86b7   Up 33 seconds (healthy)
migrate    e6c2c825d38d   Exited (0) 35 seconds ago
postgres   d2bfd48385f1   Up 43 seconds (healthy)
s3         892c7ca290f2   Up 43 seconds (healthy)
s3-init    08c2e7925d67   Exited (0) 35 seconds ago
valkey     4e223cb9301e   Up 43 seconds (healthy)
worker     d9eced386d93   Up 34 seconds (healthy)
s3-init-1  | s3-init: bucket messenger-attachments created; anonymous access: 403 (private)
migrate-1  | 2026-10-25 18:20:01,879 INFO messenger.db: Миграции применены: 001_core, 002_sessions, 003_text_as_bytes, 004_message_idempotency, 005_attachments, 006_jobs
