---
# =====================================================================================================================
# Docker Compose configuration for ACME test environment
# Provides isolated Debian 13 containers for IaC testing
# =====================================================================================================================

services:
  # Production Environment Nodes
  prod-node-01:
    build: 
      context: .
      dockerfile: Dockerfile.simple
    container_name: 101---prod-node-01
    hostname: prod-node-01
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.1.11
    ports:
      - "2211:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=prod
    restart: unless-stopped

  prod-node-02:
    build:
      context: .
      dockerfile: Dockerfile.simple
    container_name: 102---prod-node-02
    hostname: prod-node-02
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.1.12
    ports:
      - "2212:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=prod
    restart: unless-stopped

  # Stage Environment Nodes
  stage-node-01:
    build: 
      context: .
      dockerfile: Dockerfile.simple
    container_name: 201---stage-node-01
    hostname: stage-node-01
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.2.11
    ports:
      - "2221:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=stage
    restart: unless-stopped

  stage-node-02:
    build:
      context: .
      dockerfile: Dockerfile.simple
    container_name: 202---stage-node-02
    hostname: stage-node-02
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.2.12
    ports:
      - "2222:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=stage
    restart: unless-stopped

  # Development Environment Nodes
  dev-node-01:
    build: 
      context: .
      dockerfile: Dockerfile.simple
    container_name: 301---dev-node-01
    hostname: dev-node-01
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.3.11
    ports:
      - "2231:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=dev
    restart: unless-stopped

  dev-node-02:
    build:
      context: .
      dockerfile: Dockerfile.simple
    container_name: 302---dev-node-02
    hostname: dev-node-02
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.3.12
    ports:
      - "2232:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=dev
    restart: unless-stopped

  # Emergency Environment Nodes
  emerg-node-01:
    build: 
      context: .
      dockerfile: Dockerfile.simple
    container_name: 401---emerg-node-01
    hostname: emerg-node-01
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.4.11
    ports:
      - "2241:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=emerg
    restart: unless-stopped

  emerg-node-02:
    build:
      context: .
      dockerfile: Dockerfile.simple
    container_name: 402---emerg-node-02
    hostname: emerg-node-02
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.4.12
    ports:
      - "2242:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=emerg
    restart: unless-stopped

  # Legacy Test Environment Nodes (for backward compatibility)
  test-node-01:
    build: 
      context: .
      dockerfile: Dockerfile.simple
    container_name: 001---test-node-01
    hostname: test-node-01
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.0.11
    ports:
      - "2201:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=test
    restart: unless-stopped

  test-node-02:
    build:
      context: .
      dockerfile: Dockerfile.simple
    container_name: 002---test-node-02
    hostname: test-node-02
    privileged: true
    cap_add:
      - ALL
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.rp_filter=0
      - net.ipv4.conf.default.rp_filter=0
    networks:
      acme-test:
        ipv4_address: 172.25.0.12
    ports:
      - "2202:22"
    volumes:
      - ../../.vault/.ssh/customers/c_00000_acme/test/id_ed25519.pub:/root/.ssh/authorized_keys:ro
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    environment:
      - DEBIAN_FRONTEND=noninteractive
      - ENVIRONMENT=test
    restart: unless-stopped

networks:
  acme-test:
    driver: bridge
    ipam:
      config:
        - subnet: 172.25.0.0/16
          gateway: 172.25.0.1