version: '3'

services:
  proxy:
    build:
      context: .
      dockerfile: Dockerfile.proxy
    ports:
      - "3001:3000"  # Changed to 3001 externally if port 3000 is in use
    environment:
      - API_URL=http://sample-api:8080
      - DECOY_URL=http://decoy-api:8081
    depends_on:
      - sample-api
      - decoy-api
    networks:
      - security-network

  sample-api:
    build:
      context: .
      dockerfile: Dockerfile.sample-api
    networks:
      - security-network

  decoy-api:
    build:
      context: .
      dockerfile: Dockerfile.decoy-api
    networks:
      - security-network
      
  test:
    build:
      context: .
      dockerfile: Dockerfile.test
    depends_on:
      - proxy
      - sample-api
      - decoy-api
    networks:
      - security-network

networks:
  security-network:
    driver: bridge