version: '3'

volumes:
  fms:


networks:
  docker_default:
    external: true

services:
  core-rpc:
    image: ryanpower/core-rpc-docker:v1.4.9
    container_name: core-rpc
    restart: always
    ports:
      - '9101:9101'
    environment:
      DATABASE_TYPE: 'mysql'
      DATABASE_USERNAME: 'root'
      DATABASE_PASSWORD: 'p@ssw0rd123456'
      DATABASE_HOST: 'mysql-server'
      DATABASE_PORT: 3306
      DATABASE_DBNAME: 'wechat-admin'
    networks:
      docker_default:
        aliases:
          - core-rpc
    extra_hosts:
      - 'host.docker.internal:host-gateway'
      - 'mysql-server:host-gateway'

  job-rpc:
    image: ryanpower/job-rpc-docker:v1.4.9
    container_name: job-rpc
    restart: always
    ports:
      - '9105:9105'
    environment:
      DATABASE_TYPE: 'mysql'
      DATABASE_USERNAME: 'root'
      DATABASE_PASSWORD: 'p@ssw0rd123456'
      DATABASE_HOST: 'mysql-server'
      DATABASE_PORT: 3306
      DATABASE_DBNAME: 'wechat-job'
      AUTH_SECRET: 'LnQD46hBde0AgFXBer8ZZZe3FgC'
    networks:
      docker_default:
        aliases:
          - job-rpc
    extra_hosts:
      - 'host.docker.internal:host-gateway'
      - 'job-rpc:host-gateway'
      - 'mysql-server:host-gateway'

  core-api:
    image: ryanpower/core-api-docker:v1.4.9
    container_name: core-api
    restart: always
    environment:
      #     I18N_DIR: '/app/etc/'
      DATABASE_TYPE: 'mysql'
      DATABASE_USERNAME: 'root'
      DATABASE_PASSWORD: 'p@ssw0rd123456'
      DATABASE_HOST: 'mysql-server'
      DATABASE_PORT: 3306
      DATABASE_DBNAME: 'wechat-admin'
      AUTH_SECRET: 'LnQD46hBde0AgFXBer8ZZZe3FgC'
    ports:
      - '9100:9100'
    networks:
      docker_default:
        aliases:
          - core-api
    extra_hosts:
      - 'host.docker.internal:host-gateway'
      - 'job-rpc:host-gateway'
      - 'mysql-server:host-gateway'

  fms-api:
    image: ryanpower/fms-api-docker:v1.4.9
    container_name: fms-api
    restart: always
    environment:
      SERVER_URL: 'https://wxadmin.gkscrm.com/fms-file'
      DATABASE_TYPE: 'mysql'
      DATABASE_USERNAME: 'root'
      DATABASE_PASSWORD: 'p@ssw0rd123456'
      DATABASE_HOST: 'mysql-server'
      DATABASE_PORT: 3306
      DATABASE_DBNAME: 'wechat-fms'
      AUTH_SECRET: 'LnQD46hBde0AgFXBer8ZZZe3FgC'
    ports:
      - '9102:9102'
      - '81:80'
    volumes:
      - fms:/data/wechat/fms-data
    networks:
      docker_default:
        aliases:
          - fms-api
    extra_hosts:
      - 'host.docker.internal:host-gateway'
      - 'mysql-server:host-gateway'

  mcms-rpc:
    image: ryanpower/mcms-rpc-docker:v1.4.9
    container_name: mcms-rpc
    restart: always
    environment:
      DATABASE_TYPE: 'mysql'
      DATABASE_USERNAME: 'root'
      DATABASE_PASSWORD: 'p@ssw0rd123456'
      DATABASE_HOST: 'mysql-server'
      DATABASE_PORT: 3306
      DATABASE_DBNAME: 'wechat-mcms'
    networks:
      docker_default:
        aliases:
          - mcms-rpc
    extra_hosts:
      - 'host.docker.internal:host-gateway'
      - 'mysql-server:host-gateway'