#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

version: "2.1"

services:
  dolphinscheduler:
    image: apache/dolphinscheduler-standalone-server:ci
    environment:
      MASTER_MAX_CPU_LOAD_AVG: 100
      WORKER_TENANT_AUTO_CREATE: 'true'
    expose:
      - 12345
    networks:
      - e2e
    healthcheck:
      test: [ "CMD", "curl", "http://localhost:12345/actuator/health" ]
      interval: 5s
      timeout: 60s
      retries: 120
    depends_on:
      clickhouse:
        condition: service_healthy
  clickhouse:
    image: yandex/clickhouse-server:21.12.3.32
    environment:
      - CLICKHOUSE_DB=ch_test
      - CLICKHOUSE_USER=ch_test
      - CLICKHOUSE_PASSWORD=ch_test
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    expose:
      - 8123
    mem_limit: 3G
    mem_reservation: 1G
    networks:
      - e2e
    healthcheck:
      test: ["CMD", "wget", "--spider", "-q", "localhost:8123/ping"]
      interval: 5s
      timeout: 60s
      retries: 120

networks:
  e2e:
