x-depends-infra: &depends-infra depends_on: kafka: condition: service_started redis: condition: service_started postgres: condition: service_healthy clickhouse: condition: service_started elasticsearch: condition: service_healthy influxdb: condition: service_healthy setup-influxdb: condition: service_started collector: condition: service_started x-backend-env: &backend-env environment: - CLICKHOUSE_ADDRESS - CLICKHOUSE_DATABASE - CLICKHOUSE_PASSWORD - CLICKHOUSE_USERNAME - DEMO_SESSION - DEPLOYMENT_KEY - DOPPLER_CONFIG - ENABLE_OBJECT_STORAGE=true - ENVIRONMENT - FIREBASE_SECRET - FRONTEND_URI - IN_DOCKER=true - INFLUXDB_BUCKET - INFLUXDB_ORG - INFLUXDB_SERVER - INFLUXDB_TOKEN - KAFKA_SERVERS - KAFKA_TOPIC - OBJECT_STORAGE_FS=/highlight-data - OPENSEARCH_DOMAIN - OPENSEARCH_DOMAIN_READ - OPENSEARCH_PASSWORD - OPENSEARCH_USERNAME - PSQL_DB - PSQL_HOST - PSQL_PASSWORD - PSQL_PORT - PSQL_USER - PRIVATE_GRAPH_URI - PUBLIC_GRAPH_URI - REDIS_ADDRESS - REDIS_EVENTS_STAGING_ENDPOINT - SESSION_FILE_PATH_PREFIX - TZ services: zookeeper: image: confluentinc/cp-zookeeper:7.3.0 container_name: zookeeper environment: ZOOKEEPER_CLIENT_PORT: 2181 ZOOKEEPER_TICK_TIME: 2000 kafka: image: confluentinc/cp-kafka:7.3.0 container_name: kafka ports: # To learn about configuring Kafka for access across networks see # https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/ - '9092:9092' depends_on: - zookeeper environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181' KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 redis: container_name: redis image: redis ports: - 6379:6379 volumes: - redis-data:/data command: - redis-server - --save 60 1 - --loglevel warning postgres: container_name: postgres image: postgres ports: - 5432:5432 environment: POSTGRES_HOST_AUTH_METHOD: trust volumes: - postgres-data:/var/lib/postgresql/data - ../scripts/migrations/init.sql:/root/init.sql healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres'] interval: 5s timeout: 5s retries: 5 clickhouse: container_name: clickhouse image: clickhouse/clickhouse-server ports: - 8123:8123 - 9000:9000 volumes: - clickhouse-data:/var/lib/clickhouse - clickhouse-logs:/var/log/clickhouse-server elasticsearch: container_name: elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch:7.17.8 environment: discovery.type: single-node xpack.security.enabled: false ES_JAVA_OPTS: '-Xms1024m -Xmx1024m' volumes: - elasticsearch-data:/usr/share/elasticsearch/data healthcheck: test: ['CMD', 'curl', '-f', 'http://localhost:9200'] start_period: 180s interval: 5s timeout: 5s retries: 5 influxdb: container_name: influxdb image: influxdb:latest volumes: - influxdb-data:/var/lib/influxdb healthcheck: test: ['CMD', 'curl', '-f', 'http://localhost:8086/ping'] start_period: 180s interval: 5s timeout: 5s retries: 5 setup-influxdb: image: influxdb:latest command: - bash - -c - 'influx setup --host http://influxdb:8086 --skip-verify --bucket dev-bucket --org dev-org --username dev --password devdevdevdev --retention 0 --token not-a-secure-token --force' depends_on: influxdb: condition: service_healthy collector: container_name: collector image: otel/opentelemetry-collector ports: - 4317:4317 - 4318:4318 command: - '--config=/etc/otel-collector-config.yaml' volumes: - ./otel-collector.yaml:/etc/otel-collector-config.yaml backend-setup-db: image: public.ecr.aws/k9o6n7l8/highlight build: context: .. dockerfile: docker/backend.Dockerfile command: - go - run - ./migrations/main.go <<: *depends-infra <<: *backend-env backend-setup-elasticsearch: image: public.ecr.aws/k9o6n7l8/highlight build: context: .. dockerfile: docker/backend.Dockerfile command: - /bin/backend - -runtime=worker - -worker-handler=init-opensearch volumes: - highlight-data:/highlight-data <<: *depends-infra <<: *backend-env backend: container_name: backend image: public.ecr.aws/k9o6n7l8/highlight healthcheck: test: ['CMD', 'curl', '-f', '-k', 'https://localhost:8082/health'] start_period: 180s interval: 5s timeout: 5s retries: 5 ports: - 8082:8082 build: context: .. dockerfile: docker/backend.Dockerfile target: backend volumes: - highlight-data:/highlight-data depends_on: backend-setup-db: condition: service_completed_successfully backend-setup-elasticsearch: condition: service_completed_successfully <<: *backend-env frontend: container_name: frontend image: public.ecr.aws/k9o6n7l8/highlight-frontend healthcheck: test: ['CMD', 'curl', '-f', '-k', 'https://localhost:3000/'] start_period: 180s interval: 5s timeout: 5s retries: 5 ports: - 3000:3000 - 8080:8080 build: context: .. dockerfile: docker/frontend.Dockerfile target: frontend args: - REACT_APP_AUTH_MODE=simple - REACT_APP_DEMO_SESSION - REACT_APP_FIREBASE_CONFIG_OBJECT - REACT_APP_FRONTEND_ORG - REACT_APP_FRONTEND_URI - REACT_APP_ONPREM - REACT_APP_PRIVATE_GRAPH_URI - REACT_APP_PUBLIC_GRAPH_URI volumes: highlight-data: postgres-data: clickhouse-data: clickhouse-logs: redis-data: elasticsearch-data: influxdb-data: