services:
  vuln:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        SQLPARSE_VERSION: "0.4.4"
    image: cve-2024-4340-vuln:0.4.4
    container_name: cve-2024-4340-vuln
    ports:
      - "127.0.0.1:8000:8000"
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health').status==200 else 1)"]
      interval: 5s
      timeout: 3s
      retries: 5
      start_period: 5s
    restart: "no"

  patched:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        SQLPARSE_VERSION: "0.5.0"
    image: cve-2024-4340-patched:0.5.0
    container_name: cve-2024-4340-patched
    ports:
      - "127.0.0.1:8001:8000"
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health').status==200 else 1)"]
      interval: 5s
      timeout: 3s
      retries: 5
      start_period: 5s
    restart: "no"
