version: "2.1" services: apm-server: image: ${APM_DOCKER_IMAGE:-docker.elastic.co/apm/apm-server}:${STACK_VERSION:-8.0.0-SNAPSHOT} ports: - "127.0.0.1:8201:8200" - "127.0.0.1:6061:6060" command: > apm-server -e -E monitoring.enabled=true -E apm-server.expvar.enabled=true -E apm-server.instrumentation.enabled=true -E output.elasticsearch.hosts=["${ES_URL}"] -E output.elasticsearch.username=${ES_USER} -E output.elasticsearch.password=${ES_PASS} environment: - ES_URL=${ES_URL} - ES_USER=${ES_USER} - ES_PASS=${ES_PASS} cap_drop: - ALL cap_add: - CHOWN - DAC_OVERRIDE - SETGID - SETUID logging: driver: 'json-file' options: max-size: '2m' max-file: '5' healthcheck: test: ["CMD", "curl", "--write-out", "'HTTP %{http_code}'", "--silent", "--output", "/dev/null", "http://apm-server:8200/"] retries: 10 interval: 10s hey-apm: build: context: ./ dockerfile: docker/Dockerfile-bench working_dir: /app command: > /hey-apm -bench -run 5m -rm 1.2 -apm-url http://apm-server:8200 -es-url ${ES_URL} -es-auth "${ES_USER}:${ES_PASS}" -apm-es-url ${ES_URL} -apm-es-auth "${ES_USER}:${ES_PASS}" environment: - ES_URL=${ES_URL} - ES_USER=${ES_USER} - ES_PASS=${ES_PASS} volumes: - ${PWD}:/app user: ${USER_ID} mem_limit: 200m depends_on: apm-server: condition: service_healthy validate-es-url: condition: service_started validate-es-url: image: pstauffer/curl command: curl --user "${ES_USER}:${ES_PASS}" "${ES_URL}" environment: - ES_URL=${ES_URL} - ES_USER=${ES_USER} - ES_PASS=${ES_PASS} volumes: esdata: driver: local