console/integration-tests/docker-compose.integration.yaml

299 lines
8.4 KiB
YAML
Raw Normal View History

# Note: this is an overrides file for ./docker/docker-compose.community.yml:
# It's used for setting special environment and configurations for running integration tests.
2023-03-08 09:17:43 +00:00
# This file also includes services that only exists in Hive's Cloud version, and are not available in the self-hosted version.
# Please refer to TESTING.md for more information.
version: '3.8'
name: 'hive-tests'
networks:
stack:
name: hive
services:
local_cdn:
2026-01-16 14:31:31 +00:00
image: node:24.13.0-alpine3.23
working_dir: /app
command: ['node', 'index.js']
networks:
- 'stack'
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'localhost:3004/_readiness']
interval: 5s
timeout: 5s
retries: 6
start_period: 5s
ports:
- 3004:3004
volumes:
- '${PWD}/packages/services/cdn-worker/dist/index.nodejs.js:/app/index.js'
environment:
NODE_ENV: production
PORT: 3004
LOG_LEVEL: debug
CDN_AUTH_PRIVATE_KEY: 1e1064ef9cda8bf38936b77317e90dc3
S3_ENDPOINT: 'http://s3:9000'
S3_ACCESS_KEY_ID: minioadmin
S3_SECRET_ACCESS_KEY: minioadmin
S3_BUCKET_NAME: artifacts
local_broker:
2026-01-16 14:31:31 +00:00
image: node:24.13.0-alpine3.23
working_dir: /app
command: ['node', 'broker.js']
networks:
- 'stack'
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'localhost:3013/_readiness']
interval: 5s
timeout: 5s
retries: 6
start_period: 5s
ports:
- 3013:3013
volumes:
- '${PWD}/packages/services/broker-worker/dist/index.nodejs.js:/app/broker.js'
environment:
NODE_ENV: production
PORT: 3013
LOG_LEVEL: debug
CF_BROKER_SIGNATURE: secretSignature
mock_server:
image: mockserver/mockserver:5.15.0
# healthcheck - no time to implement it
# The image does not contain curl or wget.
networks:
- 'stack'
ports:
- 3042:3042
environment:
MOCKSERVER_LOG_LEVEL: DEBUG
MOCKSERVER_SERVER_PORT: 3042
composition_federation_2:
image: '${DOCKER_REGISTRY}composition-federation-2${DOCKER_TAG}'
networks:
- 'stack'
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'localhost:3069/_readiness']
interval: 5s
timeout: 5s
retries: 6
start_period: 5s
ports:
- 3069:3069
environment:
NODE_ENV: production
PORT: 3069
LOG_LEVEL: debug
SECRET: '${EXTERNAL_COMPOSITION_SECRET}'
external_composition:
2026-01-16 14:31:31 +00:00
image: node:24.13.0-alpine3.23
working_dir: /app
command: ['node', 'example.mjs']
networks:
- 'stack'
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'localhost:3012/_readiness']
interval: 5s
timeout: 5s
retries: 6
start_period: 5s
ports:
- 3012:3012
volumes:
- '${PWD}/packages/libraries/external-composition/dist/example.js:/app/example.mjs'
environment:
NODE_ENV: production
PORT: 3012
LOG_LEVEL: debug
SECRET: '${EXTERNAL_COMPOSITION_SECRET}'
commerce:
image: '${DOCKER_REGISTRY}commerce${DOCKER_TAG}'
networks:
- 'stack'
ports:
- 3009:3009
depends_on:
clickhouse:
condition: service_healthy
migrations:
condition: service_completed_successfully
environment:
NODE_ENV: production
LOG_LEVEL: debug
LIMIT_CACHE_UPDATE_INTERVAL_MS: '${LIMIT_CACHE_UPDATE_INTERVAL_MS}'
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: '${POSTGRES_DB}'
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
CLICKHOUSE_PROTOCOL: 'http'
CLICKHOUSE_HOST: 'clickhouse'
CLICKHOUSE_PORT: '8123'
CLICKHOUSE_USERNAME: '${CLICKHOUSE_USER}'
CLICKHOUSE_PASSWORD: '${CLICKHOUSE_PASSWORD}'
STRIPE_SECRET_KEY: empty
PORT: 3009
# Overrides only to `docker-compose.community.yaml` from now on:
server:
environment:
CDN_CF: '1'
CDN_CF_BASE_PATH: http://local_cdn:3004
CDN_CF_ACCOUNT_ID: 103df45224310d669213971ce28b5b70
CDN_CF_AUTH_TOKEN: 85e20c26c03759603c0f45884824a1c3
CDN_CF_NAMESPACE_ID: 33b1e3bbb4a4707d05ea0307cbb55c79
CDN_CF_BASE_URL: http://localhost:3004
CDN_AUTH_PRIVATE_KEY: 1e1064ef9cda8bf38936b77317e90dc3
CDN_API: '1'
CDN_API_BASE_URL: 'http://localhost:3001'
REQUEST_BROKER: '1'
REQUEST_BROKER_SIGNATURE: 'secretSignature'
REQUEST_BROKER_ENDPOINT: 'http://local_broker:3013'
GITHUB_APP_ID: 123123
GITHUB_APP_PRIVATE_KEY: 5f938d51a065476c4dc1b04aeba13afb
FEEDBACK_SLACK_TOKEN: ''
FEEDBACK_SLACK_CHANNEL: '#hive'
COMMERCE_ENDPOINT: '${COMMERCE_ENDPOINT}'
EMAIL_PROVIDER: '${EMAIL_PROVIDER}'
LOG_LEVEL: debug
# Auth
WEB_APP_URL: '${HIVE_APP_BASE_URL}'
AUTH_ORGANIZATION_OIDC: '1'
AUTH_REQUIRE_EMAIL_VERIFICATION: '0'
SUPERTOKENS_CONNECTION_URI: http://supertokens:3567
SUPERTOKENS_API_KEY: '${SUPERTOKENS_API_KEY}'
GRAPHQL_PUBLIC_ORIGIN: http://localhost:8082
broker:
image: redpandadata/redpanda:latest
hostname: broker
networks:
- 'stack'
command:
- redpanda
- start
- --smp
- '1'
- --set redpanda.empty_seed_starts_cluster=false
- --seeds "redpanda-1:33145"
- --kafka-addr
- PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr
- PLAINTEXT://broker:29092,OUTSIDE://localhost:9092
- --pandaproxy-addr
- PLAINTEXT://0.0.0.0:28082,OUTSIDE://0.0.0.0:8082
- --advertise-pandaproxy-addr
- PLAINTEXT://broker:28082,OUTSIDE://localhost:8082
- --advertise-rpc-addr redpanda-1:33145
mem_limit: 300m
mem_reservation: 100m
healthcheck:
test: 'curl -f http://localhost:9644/public_metrics'
interval: 3s
timeout: 3s
retries: 6
start_period: 5s
db:
ports:
- '5432:5432'
clickhouse:
ports:
- '8123:8123'
volumes:
- ./.hive/clickhouse/logs:/var/log/clickhouse-server
- ./.hive/clickhouse/db:/var/lib/clickhouse
- ./configs/clickhouse:/etc/clickhouse-server/conf.d
supertokens:
ports:
- '3567:3567'
usage:
environment:
COMMERCE_ENDPOINT: '${COMMERCE_ENDPOINT}'
RATE_LIMIT_TTL: 1000
LOG_LEVEL: debug
depends_on:
broker:
condition: service_started # Redpand is ready when it starts
tokens:
condition: service_healthy
usage-ingestor:
environment:
CLICKHOUSE_ASYNC_INSERT_BUSY_TIMEOUT_MS: '${CLICKHOUSE_ASYNC_INSERT_BUSY_TIMEOUT_MS}'
CLICKHOUSE_ASYNC_INSERT_MAX_DATA_SIZE: '${CLICKHOUSE_ASYNC_INSERT_MAX_DATA_SIZE}'
LOG_LEVEL: debug
depends_on:
broker:
condition: service_started # Redpand is ready when it starts
tokens:
condition: service_healthy
workflows:
environment:
EMAIL_PROVIDER: '${EMAIL_PROVIDER}'
LOG_LEVEL: debug
ports:
- '3014:3014'
schema:
environment:
LOG_LEVEL: debug
REQUEST_BROKER: '1'
REQUEST_BROKER_SIGNATURE: 'secretSignature'
REQUEST_BROKER_ENDPOINT: 'http://local_broker:3013'
ports:
- '3002:3002'
otel-collector:
depends_on:
clickhouse:
condition: service_healthy
server:
condition: service_healthy
build:
context: ${PWD}/docker/configs/otel-collector
dockerfile: ${PWD}/docker/otel-collector.dockerfile
environment:
HIVE_OTEL_AUTH_ENDPOINT: 'http://server:3001/otel-auth'
CLICKHOUSE_PROTOCOL: 'http'
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_USERNAME: '${CLICKHOUSE_USER}'
CLICKHOUSE_PASSWORD: '${CLICKHOUSE_PASSWORD}'
volumes:
- '${PWD}/docker/configs/otel-collector/builder-config.yaml:/builder-config.yaml'
- '${PWD}/docker/configs/otel-collector/config.yaml:/etc/otel-config.yaml'
ports:
- '4317:4317'
- '4318:4318'
networks:
- 'stack'
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'localhost:13133']
interval: 5s
timeout: 5s
retries: 6
start_period: 10s
#
# Awkwardly, we need to override some services for different reasons
#
# It's not part of integration tests
app:
2026-01-16 14:31:31 +00:00
image: node:24.13.0-alpine3.23
2023-01-02 13:22:40 +00:00
command: ['npx', 'http-server']
# Redpand is used for integration tests, instead of Kafka. Zookeeper is no longer needed
zookeeper:
2026-01-16 14:31:31 +00:00
image: node:24.13.0-alpine3.23
command: ['npx', 'http-server']