Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

4.8 KB
Raw Blame
# Keep the current-version ClickHouse services on the same image.
x-clickhouse-image: &clickhouse-image 'clickhouse/clickhouse-server:latest-alpine'

services:

  ##########################################################################################################
  # ClickHouse single node (CH driver + Metabase tests)
  ##########################################################################################################

  clickhouse:
    image: *clickhouse-image
    container_name: 'mb-clickhouse-latest'
    hostname: clickhouse
    ports:
      - '127.0.0.1:8123:8123'
      - '127.0.0.1:9000:9000'
    environment:
      CLICKHOUSE_SKIP_USER_SETUP: 1
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    volumes:
      - './.docker/clickhouse/single_node/config.xml:/etc/clickhouse-server/config.xml'
      - './.docker/clickhouse/single_node/users.xml:/etc/clickhouse-server/users.xml'
      - './init.sql:/docker-entrypoint-initdb.d/init.sql'

  ##########################################################################################################
  # ClickHouse single node (CH driver TLS tests only)
  ##########################################################################################################

  clickhouse_tls:
    build:
      context: ./
      dockerfile: .docker/clickhouse/single_node_tls/Dockerfile
    container_name: 'metabase-driver-clickhouse-server-tls'
    ports:
      - '127.0.0.1:8443:8443'
      - '127.0.0.1:9440:9440'
    environment:
      CLICKHOUSE_SKIP_USER_SETUP: 1
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    volumes:
      - './.docker/clickhouse/single_node_tls/config.xml:/etc/clickhouse-server/config.xml'
      - './.docker/clickhouse/single_node_tls/users.xml:/etc/clickhouse-server/users.xml'
    hostname: server.clickhouseconnect.test

  ##########################################################################################################
  # Older ClickHouse version (CH driver tests only)
  # For testing pre-23.8 string functions switch between UTF8 and non-UTF8 versions (see clickhouse_qp.clj)
  ##########################################################################################################

  clickhouse_older_version:
    # if the oldest supported veresion changes please update fetch-oldest-supported-version in mage/mage/start_db.clj
    image: 'clickhouse/clickhouse-server:23.3-alpine'
    container_name: 'mb-clickhouse-oldest'
    hostname: clickhouse.older
    ports:
      - '127.0.0.1:8124:8123'
      - '127.0.0.1:9001:9000'
    environment:
      CLICKHOUSE_SKIP_USER_SETUP: 1
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    volumes:
      - './.docker/clickhouse/single_node/config.xml:/etc/clickhouse-server/config.xml'
      - './.docker/clickhouse/single_node/users.xml:/etc/clickhouse-server/users.xml'

  ##########################################################################################################
  # ClickHouse cluster (CH driver SET ROLE tests only)
  # See test/metabase/driver/clickhouse_set_role.clj
  ##########################################################################################################

  clickhouse_cluster_node1:
    image: *clickhouse-image
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    hostname: clickhouse1
    container_name: metabase-driver-clickhouse-cluster-node-1
    ports:
      - '127.0.0.1:8125:8123'
      - '127.0.0.1:9002:9000'
      - '127.0.0.1:9181:9181'
    environment:
      CLICKHOUSE_SKIP_USER_SETUP: 1
    volumes:
      - './.docker/clickhouse/cluster/server1_config.xml:/etc/clickhouse-server/config.xml'
      - './.docker/clickhouse/cluster/server1_macros.xml:/etc/clickhouse-server/config.d/macros.xml'
      - './.docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml'

  clickhouse_cluster_node2:
    image: *clickhouse-image
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    hostname: clickhouse2
    container_name: metabase-driver-clickhouse-cluster-node-2
    ports:
      - '127.0.0.1:8126:8123'
      - '127.0.0.1:9003:9000'
      - '127.0.0.1:9182:9181'
    environment:
      CLICKHOUSE_SKIP_USER_SETUP: 1
    volumes:
      - './.docker/clickhouse/cluster/server2_config.xml:/etc/clickhouse-server/config.xml'
      - './.docker/clickhouse/cluster/server2_macros.xml:/etc/clickhouse-server/config.d/macros.xml'
      - './.docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml'

  # Using Nginx as a cluster entrypoint and a round-robin load balancer for HTTP requests
  # See .docker/nginx/local.conf for the configuration
  nginx:
    image: 'nginx:1.23.1-alpine'
    hostname: nginx
    ports:
      - '127.0.0.1:8127:8123'
    volumes:
      - './.docker/nginx/local.conf:/etc/nginx/conf.d/local.conf'
    container_name: metabase-nginx