services:
  hcd:
    image: cp.icr.io/cp/cpd/ibm-datastax-hcd/hcd:1.2.4-ubi
    platform: linux/amd64
    networks:
      - hcd
    mem_limit: 3G
    environment:
      - MAX_HEAP_SIZE=1536M
      - CLUSTER_NAME=hcd-cluster
      - DS_LICENSE=accept
      - HCD_AUTO_CONF_OFF=cassandra.yaml
      - JVM_EXTRA_OPTS=-Dcassandra.sai.latest.version=ec
    volumes:
      - ${PWD}/cassandra.yaml:/opt/hcd/resources/cassandra/conf/cassandra.yaml:r
    ports:
      - 9042:9042
    healthcheck:
      test: [ "CMD-SHELL", "cqlsh -u cassandra -p cassandra -e 'describe keyspaces'" ]
      interval: 15s
      timeout: 10s
      retries: 20

  data-api:
    image: cp.icr.io/cp/cpd/ibm-datastax-hcd/data-api:v1.0.33
    depends_on:
      hcd:
        condition: service_healthy
    networks:
      - hcd
    ports:
      - 8181:8181
    mem_limit: 2G
    environment:
      - JAVA_MAX_MEM_RATIO=75
      - JAVA_INITIAL_MEM_RATIO=50
      - GC_CONTAINER_OPTIONS=-XX:+UseG1GC
      - STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_CASSANDRA_END_POINTS=hcd
      - STARGATE_JSONAPI_OPERATIONS_DATABASE_CONFIG_LOCAL_DATACENTER=dc1
      - QUARKUS_HTTP_ACCESS_LOG_ENABLED=false
      - QUARKUS_LOG_LEVEL=info
      - STARGATE_JSONAPI_OPERATIONS_VECTORIZE_ENABLED=true
      - STARGATE_FEATURE_FLAGS_TABLES=true
      - JAVA_OPTS_APPEND=-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager
    healthcheck:
      test: curl -f http://localhost:8181/stargate/health || exit 1
      interval: 5s
      timeout: 10s
      retries: 10
networks:
  hcd:

# Made with Bob
