dolphinscheduler docker compose安装配置

database init

#!/bin/sh

docker run -d --name dolphinscheduler-tools \
    -e DATABASE="postgresql" \
    -e SPRING_DATASOURCE_URL="jdbc:postgresql://localhost:5432/dolphinscheduler" \
    -e SPRING_DATASOURCE_USERNAME="root" \
    -e SPRING_DATASOURCE_PASSWORD="123456" \
    --net host \
    apache/dolphinscheduler-tools:"3.1.8" tools/bin/upgrade-schema.sh

.env

DolphinScheduler_HOME=/opt/apache/dolphinscheduler
DolphinScheduler_MASTER_PORT=5678
DolphinScheduler_WORKER_PORT=1234
DolphinScheduler_API_PORT=12345
DolphinScheduler_ALERT_PORT=50052
Zookeeper_CONNECT_STRING=zoo1:2181,zoo2:2182,zoo3:2183

docker-compose.yml

version: '3.1'

services:
  dolphinscheduler-master:
    image: apache/dolphinscheduler-master:3.1.8
    restart: always
    env_file:
      - .env
    hostname: dolphinscheduler-master
    extra_hosts:
      - "zoo1:192.168.0.208"
      - "zoo2:192.168.0.208"
      - "zoo3:192.168.0.208"
      - "postgresql-database:192.168.0.208"
    expose:
      - "${DolphinScheduler_MASTER_PORT}"
    deploy:
      replicas: 1
    environment:
      DATABASE: postgresql
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgresql-database:5432/dolphinscheduler
      SPRING_DATASOURCE_USERNAME: root
      SPRING_DATASOURCE_PASSWORD: 123456
      REGISTRY_ZOOKEEPER_CONNECT_STRING: "${Zookeeper_CONNECT_STRING}"
  dolphinscheduler-worker:
    image: apache/dolphinscheduler-worker:3.1.8
    restart: always
    env_file:
      - .env
    hostname: dolphinscheduler-worker
    extra_hosts:
      - "zoo1:192.168.0.208"
      - "zoo2:192.168.0.208"
      - "zoo3:192.168.0.208"
      - "postgresql-database:192.168.0.208"
    expose:
      - "${DolphinScheduler_WORKER_PORT}"
    deploy:
      replicas: 1
    environment:
      DATABASE: postgresql
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgresql-database:5432/dolphinscheduler
      SPRING_DATASOURCE_USERNAME: root
      SPRING_DATASOURCE_PASSWORD: 123456
      REGISTRY_ZOOKEEPER_CONNECT_STRING: "${Zookeeper_CONNECT_STRING}"
  dolphinscheduler-api:
    image: apache/dolphinscheduler-api:3.1.8
    restart: always
    env_file:
      - .env
    hostname: dolphinscheduler-api
    extra_hosts:
      - "zoo1:192.168.0.208"
      - "zoo2:192.168.0.208"
      - "zoo3:192.168.0.208"
      - "postgresql-database:192.168.0.208"
    expose:
      - "${DolphinScheduler_API_PORT}"
    ports:
      - ${DolphinScheduler_API_PORT}:${DolphinScheduler_API_PORT}
    deploy:
      replicas: 1
    environment:
      DATABASE: postgresql
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgresql-database:5432/dolphinscheduler
      SPRING_DATASOURCE_USERNAME: root
      SPRING_DATASOURCE_PASSWORD: 123456
      REGISTRY_ZOOKEEPER_CONNECT_STRING: "${Zookeeper_CONNECT_STRING}"
  dolphinscheduler-alert-server:
    image: apache/dolphinscheduler-alert-server:3.1.8
    restart: always
    env_file:
      - .env
    hostname: dolphinscheduler-alert-server
    extra_hosts:
      - "zoo1:192.168.0.208"
      - "zoo2:192.168.0.208"
      - "zoo3:192.168.0.208"
      - "postgresql-database:192.168.0.208"
    expose:
      - "${DolphinScheduler_ALERT_PORT}"
    deploy:
      replicas: 1
    environment:
      DATABASE: postgresql
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgresql-database:5432/dolphinscheduler
      SPRING_DATASOURCE_USERNAME: root
      SPRING_DATASOURCE_PASSWORD: 123456
      REGISTRY_ZOOKEEPER_CONNECT_STRING: "${Zookeeper_CONNECT_STRING}"

你可能感兴趣的:(docker-compose,docker,容器,运维)