Skip to content

Compose the stack

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

Now that you have both configuration files ready, combine them into a Docker Compose stack.

  1. Create docker-compose.yml in the project directory. This file defines the three services that make up the dispute-search pipeline locally: Aerospike Database, the Elasticsearch connector, and Elasticsearch. A fourth aerospike-tools container lets you simulate authorization-service writes with aql. The volumes entries mount the aerospike.conf and aerospike-elasticsearch-outbound.yml files you created earlier into their respective containers. On startup, the Aerospike Database and Elasticsearch connector images use these configuration files instead of their default settings.

    docker-compose.yml
    name: aerospike-elastic-quickstart
    services:
    aerospike:
    image: aerospike/aerospike-server-enterprise:8.1.1.0
    container_name: aerospike
    volumes:
    - ./aerospike.conf:/etc/aerospike/aerospike.template.conf:ro
    - ./features.conf:/etc/aerospike/features.conf:ro
    healthcheck:
    test: ["CMD", "asinfo", "-v", "status"]
    interval: 5s
    timeout: 5s
    retries: 10
    elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:9.5.0
    container_name: elasticsearch
    environment:
    - discovery.type=single-node
    - xpack.security.enabled=false
    - ES_JAVA_OPTS=-Xms512m -Xmx512m
    ports:
    - "127.0.0.1:9200:9200"
    healthcheck:
    test: ["CMD-SHELL", "curl -sf http://localhost:9200/_cluster/health >/dev/null"]
    interval: 5s
    timeout: 5s
    retries: 20
    aerospike-elasticsearch-outbound:
    image: aerospike/aerospike-elasticsearch-outbound:3.0.2
    container_name: aerospike-elasticsearch-outbound
    volumes:
    - ./aerospike-elasticsearch-outbound.yml:/etc/aerospike-elasticsearch-outbound/aerospike-elasticsearch-outbound.yml:ro
    ports:
    - "127.0.0.1:8902:8902"
    depends_on:
    aerospike:
    condition: service_healthy
    elasticsearch:
    condition: service_healthy
    aerospike-tools:
    image: aerospike/aerospike-tools:13.0.1
    container_name: aerospike-tools
    depends_on:
    aerospike:
    condition: service_healthy
    entrypoint: ["sleep", "infinity"]

    The connector’s depends_on health checks make it wait for both Aerospike and Elasticsearch, so it never tries to ship a dispute record before Elasticsearch can index it.

  2. Validate the Compose file.

    Terminal
    docker compose config --quiet

    The command exits without output when the file is valid. aerospike.conf mounts to /etc/aerospike/aerospike.template.conf, not /etc/aerospike/aerospike.conf, because the Aerospike image renders the template into its final configuration file at startup. aerospike-elasticsearch-outbound.yml mounts directly to the path the Elasticsearch connector reads on startup, with no rendering step.