version: "2.1" services: opbeans-dotnet: build: . image: opbeans/opbeans-dotnet:latest ports: - "127.0.0.1:${OPBEANS_DOTNET_PORT:-3000}:80" container_name: opbeans-dotnet logging: driver: 'json-file' options: max-size: '2m' max-file: '5' environment: - ELASTIC_APM_SERVICE_NAME=${ELASTIC_APM_SERVICE_NAME:-opbeans-dotnet} - ELASTIC_APM_SERVER_URLS=${ELASTIC_APM_SERVER_URL:-http://apm-server:8200} - ELASTIC_APM_JS_SERVER_URL=${ELASTIC_APM_JS_SERVER_URL:-http://localhost:8200} - ELASTIC_APM_ENVIRONMENT=testing - ELASTIC_APM_LOG_FILE=stderr - ELASTIC_APM_LOG_LEVEL=debug depends_on: apm-server: condition: service_healthy healthcheck: test: ["CMD-SHELL", "wget --quiet --tries=1 --spider http://localhost:80/ || exit 1"] retries: 10 interval: 20s opbeans-frontend: build: . image: docker.elastic.co/observability-ci/it_opbeans-frontend_nginx:latest ports: - "127.0.0.1:${OPBEANS_DOTNET_PORT:-8000}:3000" container_name: opbeans-frontend logging: driver: 'json-file' options: max-size: '2m' max-file: '5' environment: - ELASTIC_OPBEANS_API_SERVER=${ELASTIC_OPBEANS_API_SERVER:-http://opbeans-dotnet} - ELASTIC_APM_SERVER_URLS=${ELASTIC_APM_SERVER_URLS:-http://localhost:8200} depends_on: opbeans-dotnet: condition: service_healthy healthcheck: test: ["CMD-SHELL", "exit 0"] retries: 10 interval: 20s apm-server: image: docker.elastic.co/apm/apm-server:${STACK_VERSION:-7.3.0} ports: - "127.0.0.1:${APM_SERVER_PORT:-8200}:8200" - "127.0.0.1:${APM_SERVER_MONITOR_PORT:-6060}:6060" command: > apm-server -e -E apm-server.frontend.enabled=true -E apm-server.frontend.rate_limit=100000 -E apm-server.host=0.0.0.0:8200 -E apm-server.read_timeout=1m -E apm-server.shutdown_timeout=2m -E apm-server.write_timeout=1m -E apm-server.rum.enabled=true -E setup.kibana.host=kibana:5601 -E setup.template.settings.index.number_of_replicas=0 -E xpack.monitoring.elasticsearch=true -E output.elasticsearch.enabled=${APM_SERVER_ELASTICSEARCH_OUTPUT_ENABLED:-true} cap_drop: - ALL cap_add: - CHOWN - DAC_OVERRIDE - SETGID - SETUID logging: driver: 'json-file' options: max-size: '2m' max-file: '5' depends_on: elasticsearch: condition: service_healthy healthcheck: test: ["CMD", "curl", "--write-out", "'HTTP %{http_code}'", "--silent", "--output", "/dev/null", "http://apm-server:8200/"] retries: 10 interval: 10s elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-7.3.0} environment: - cluster.name=docker-cluster - xpack.security.enabled=false - bootstrap.memory_lock=true - network.host=0.0.0.0 - discovery.type=single-node - "ES_JAVA_OPTS=-Xms1g -Xmx1g" - "path.data=/usr/share/elasticsearch/data/${STACK_VERSION:-7.3.0}" ulimits: memlock: soft: -1 hard: -1 mem_limit: 2g logging: driver: 'json-file' options: max-size: '2m' max-file: '5' ports: - "127.0.0.1:${ELASTICSEARCH_PORT:-9200}:9200" healthcheck: test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'"] retries: 10 interval: 20s volumes: - esdata:/usr/share/elasticsearch/data kibana: image: docker.elastic.co/kibana/kibana:${STACK_VERSION:-7.3.0} environment: SERVER_NAME: kibana.example.org ELASTICSEARCH_URL: http://elasticsearch:9200 ports: - "127.0.0.1:${KIBANA_PORT:-5601}:5601" 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://kibana:5601/"] retries: 10 interval: 10s depends_on: elasticsearch: condition: service_healthy wait: image: busybox depends_on: opbeans-frontend: condition: service_healthy volumes: esdata: driver: local