# HARDENED counterpart for labs/docker-security. name: dockerlab-hardened services: app: build: context: ../app dockerfile: ../hardened/Dockerfile image: dockerlab/posture:hardened user: "65532:65532" read_only: true tmpfs: - /tmp:rw,noexec,nosuid,nodev,size=8m,mode=1777 cap_drop: - ALL security_opt: - no-new-privileges:true - seccomp=./seccomp.json mem_limit: 128m memswap_limit: 128m cpus: 0.5 pids_limit: 64 # healthcheck is inherited from the image's HEALTHCHECK instruction. restart: "no" stop_grace_period: 5s networks: - isolated # Present so the probe can show that the isolated app cannot reach it. It gets # the same container-level hardening so the static policy gate covers it too. canary: image: busybox:1.37@sha256:a7dbc319b1438115a207e11930dc4bb3e643dcb3ec0bdd694bb36cd8fad289ec command: ["httpd", "-f", "-p", "9000", "-h", "/www"] user: "65534:65534" read_only: true tmpfs: - /www:rw,noexec,nosuid,nodev,size=1m,mode=1777 cap_drop: - ALL security_opt: - no-new-privileges:true mem_limit: 32m memswap_limit: 32m cpus: 0.25 pids_limit: 16 restart: "no" networks: - reachable networks: isolated: internal: true reachable: {}