# OrbStack optimized settings x-common-settings: &common restart: unless-stopped logging: driver: "json-file" options: max-size: "10m" max-file: "3" services: tidb: <<: *common image: pingcap/tidb:latest container_name: tidb hostname: tidb.orb.local # OrbStack DNS command: - tidb-server - --store=unistore - --path=/tmp/tidb - --advertise-address=tidb ports: - "4000:4000" - "10080:10080" volumes: - tidb_data:/tmp/tidb environment: - TIDB_ENABLE_TELEMETRY=false healthcheck: test: ["CMD", "wget", "-q", "-O-", "http://127.0.0.1:10080/status"] interval: 10s timeout: 5s retries: 3 start_period: 10s deploy: resources: limits: cpus: '2' memory: 2G reservations: cpus: '1' memory: 1G dm-master: <<: *common image: pingcap/dm:latest container_name: dm-master hostname: dm-master.orb.local command: - /dm-master - --master-addr=:8261 - --advertise-addr=dm-master:8261 ports: - "8261:8261" volumes: - dm_master_data:/data - ./configs:/configs:ro healthcheck: test: ["CMD", "wget", "-q", "-O-", "http://127.0.0.1:8261/status"] interval: 10s timeout: 5s retries: 3 start_period: 5s deploy: resources: limits: cpus: '0.5' memory: 512M dm-worker: <<: *common image: pingcap/dm:latest container_name: dm-worker hostname: dm-worker.orb.local command: - /dm-worker - --worker-addr=:8262 - --advertise-addr=dm-worker:8262 - --join=dm-master:8261 volumes: - dm_worker_data:/data - ./configs:/configs:ro depends_on: tidb: condition: service_healthy dm-master: condition: service_healthy healthcheck: test: ["CMD", "wget", "-q", "-O-", "http://127.0.0.1:8262/status"] interval: 10s timeout: 5s retries: 3 start_period: 5s deploy: resources: limits: cpus: '1' memory: 1G dm-init: image: pingcap/dm:latest container_name: dm-init volumes: - ./configs:/configs:ro - ./scripts:/scripts:ro environment: - TEST_DB_HOST=${TEST_DB_HOST} - TEST_DB_PORT=${TEST_DB_PORT} - TEST_DB_USER=${TEST_DB_USER} - TEST_DB_PASSWORD=${TEST_DB_PASSWORD} - DATABASE_NAME=${DATABASE_NAME} - TABLES=${TABLES} depends_on: dm-worker: condition: service_healthy command: ["/bin/sh", "/scripts/init-dm.sh"] restart: "no" volumes: tidb_data: driver: local dm_master_data: driver: local dm_worker_data: driver: local networks: default: name: tidb-network