services:
  web:
    build:
      context: .
    ports:
      # Loopback only.
      - "127.0.0.1:9001:8080"
    networks:
      - training_only
    user: "65534:65534"
    read_only: true
    tmpfs:
      - /tmp
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    restart: "no"

  proof:
    profiles:
      - proof
    build:
      context: .
    command: ["python3", "/tools/poc.py", "http://web:8080", "--lab"]
    depends_on:
      - web
    networks:
      - training_only
    user: "65534:65534"
    read_only: true
    tmpfs:
      - /tmp
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    restart: "no"

networks:
  training_only:
    # A normal bridge: `internal: true` blocks host port publishing, which the
    # loopback bind in `web.ports` depends on.
    driver: bridge
