services:
  # neo4j:
  #   image: neo4j:5-enterprise
  #   hostname: neo4j
  #   container_name: neo4j
  #   # this is to ensure you have the latest 5.x version of the database
  #   pull_policy: always
  #   ports:
  #     - "7474:7474"
  #     - "7687:7687"
  #   environment:
  #     NEO4J_AUTH: neo4j/uc4t2qLVD@rnWuiW
  #     NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
  #     NEO4J_server_memory_heap_max__size: "4G"
  #   healthcheck:
  #     test: [ "CMD", "cypher-shell", "-u", "neo4j", "-p", "uc4t2qLVD@rnWuiW", "RETURN 1" ]
  #     start_period: 2m
  #     start_interval: 10s
  #     interval: 30s
  #     timeout: 10s
  #     retries: 5

  kafka-connect-neo4j-cdc-source:
    build:
      dockerfile: Dockerfile
      context: .
    ports:
      - "8083:8083"
    # depends_on:
    #   - neo4j
    healthcheck:
        test: ["CMD-SHELL", "curl -f http://localhost:8083/connectors || exit 1" ]
        interval: 30s
        timeout: 5s
        retries: 5
    environment:
      Environment: 'local'
      CONNECT_GROUP_UNIQUE_IDENTIFIER: "${USER}-localnam"
      AWS_REGION: "${AWS_REGION}"
      AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID}"
      AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}"
      AWS_SESSION_TOKEN: "${AWS_SESSION_TOKEN}"
    env_file:
      - .env
    entrypoint: ["/bin/bash", "-c", "export OVERRIDE_CONFIGS=$(cat /tmp/config_override.json); exec /usr/local/bin/entry_point.sh"]
    volumes:
      - ${PWD}/.env:/etc/kafka-connect/connector_config.properties
      - ${HOME}/.aws:/home/appuser/.aws
      - ${PWD}/config_override.json:/tmp/config_override.json
  