date: 2026-11-05T19:19:26.962774+00:00  commit: 252e3e3ffeea5004cfd9dc342e686af1417a77a2
NO_PROXY=localhost,127.0.0.1,::1 COMPOSE_PROJECT_NAME=mtusi2026lab3-grade4-20261105 LB_HTTP_PORT=18083 LB_STATS_PORT=23083 API_REPLICAS=2
$ env API_REPLICAS=1 COMPOSE_FILE=compose.yaml:/tmp/lab3-grade4-violations.yaml python3 scripts/limits.py --out evidence/limits-violations.txt
date: 2026-11-05T19:19:27Z  commit: 252e3e3
$ docker compose --profile bench config --format json  (declared)
service   cpus/mem    ports                            secrets                                                 volumes     networks                ro
--------  ----------  -------------------------------  ------------------------------------------------------  ----------  ----------------------  -----
api       -/512MiB    127.0.0.1:23998                  cache_url,cursor_secret,database_url,postgres_password  -           backend(internal)       false
k6        2/512MiB    -                                -                                                       -           edge                    false
lb        1/128MiB    127.0.0.1:18083,127.0.0.1:23083  -                                                       -           backend(internal),edge  true
migrate   0.5/256MiB  -                                database_url                                            -           backend(internal)       false
postgres  2/1024MiB   -                                postgres_password                                       pgdata      backend(internal)       false
valkey    0.5/128MiB  -                                valkey.conf                                             valkeydata  backend(internal)       false

$ docker inspect  (running containers: hostname = X-Instance-Id, applied limits)
service   hostname      cpus  memory   published
--------  ------------  ----  -------  ---------------------------------------------------
api       5bbf259ff136  1     512MiB
api       7cfd91ddf780  1     512MiB
lb        4f83577b3411  1     128MiB   127.0.0.1:18083->8080/tcp,127.0.0.1:23083->8404/tcp
postgres  f225c6cd77bb  2     1024MiB
valkey    5e3ed0a9a35a  0.5   128MiB

FAIL: api: no CPU or memory limit
FAIL: api: container_name prevents scaling
FAIL: api: secrets ['cache_url', 'cursor_secret', 'database_url', 'postgres_password'], policy ['cache_url', 'cursor_secret', 'database_url']
FAIL: api: publishes ['127.0.0.1:23998'] in bypass of the balancer
FAIL: api: root filesystem is writable
FAIL: 5 violation(s)

exit: 1  elapsed_seconds: 0.227

Temporary override (configuration was inspected only; never applied):
services:
  api:
    container_name: forbidden-scale-name
    read_only: false
    ports:
      - "127.0.0.1:23998:8080"
    secrets:
      - postgres_password
    deploy:
      resources:
        limits:
          cpus: "0"
