version: '3'
services:
  db:
    image: 'registry.cn-hangzhou.aliyuncs.com/72crm/mysql:5.7'
    container_name: mysql
    volumes:
      - ./conf/mysql/mysqld.cnf:/etc/mysql/conf.d/source/mysqld.cnf
      - ./data/mysql/data:/var/lib/mysql
      - ./data/mysql/init:/docker-entrypoint-initdb.d/
      - ./log/mysql:/var/log/mysql/
      - ./mysql.sh:/mysql.sh
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - TZ=Asia/Shanghai
      - LANG=en_US.UTF-8
    networks:
      wkcrm_network:
    ports:
      - '3306:3306'
    entrypoint: /mysql.sh
    restart: always
  redis:
    image: 'registry.cn-hangzhou.aliyuncs.com/72crm/redis:6.0.8'
    container_name: redis
    volumes:
      - ./conf/redis/redis.conf:/etc/redis.conf
    ports:
      - '6379:6379'
    networks:
      wkcrm_network:
    command: [ "redis-server", "/etc/redis.conf" ]
    restart: always
  elasticsearch:
    image: registry.cn-hangzhou.aliyuncs.com/72crm/elasticsearch:6.8.6
    container_name: elasticsearch
    volumes:
      - ./data/elasticsearch/data:/usr/share/elasticsearch/data
      - ./data/elasticsearch/plugins:/usr/share/elasticsearch/plugins
    environment:
      - discovery.type=single-node
      - TZ=Asia/Shanghai
      - LANG=en_US.UTF-8
    ports:
      - "9200:9200"
    networks:
      wkcrm_network:
    restart: always
  nacos:
    image: registry.cn-hangzhou.aliyuncs.com/72crm/nacos:1.2.1
    container_name: nacos
    environment:
      - MODE=standalone
      - TZ=Asia/Shanghai
      - LANG=en_US.UTF-8
    depends_on:
      - db
    volumes:
      - ./conf/nacos:/home/nacos/conf
      - ./log/nacos:/home/nacos/logs
      - ./nacos.sh:/nacos.sh
    entrypoint: /nacos.sh -c 'echo "start web service here"'
    ports:
      - "8848:8848"
    networks:
      wkcrm_network:
    restart: always
  xxl-job-admin:
    image: registry.cn-hangzhou.aliyuncs.com/72crm/xxl-job:2.1.2
    container_name: xxl-job-admin
    volumes:
      - ./log/xxl-job:/data/applogs/xxl-job/
    environment:
      PARAMS: '--spring.datasource.url=jdbc:mysql://mysql:3306/xxl_job?Unicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai --spring.datasource.username=root --spring.datasource.password=password'
    ports:
      - "8080:8080"
    networks:
      wkcrm_network:
    restart: always
  nginx:
    image: registry.cn-hangzhou.aliyuncs.com/72crm/nginx:latest
    container_name: "nginx"
    ports:
      - "80:80"
    volumes:
      - ./log/nginx/:/var/log/nginx/
      - ./conf/nginx/conf.d/:/etc/nginx/conf.d/
      - ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf
    networks:
      wkcrm_network:
    restart: always
  wkcrm:
    image: registry.cn-hangzhou.aliyuncs.com/72crm/crm:11.3.4
    container_name: "wkcrm"
    environment:
      - TZ=Asia/Shanghai
      - LANG=en_US.UTF-8
    volumes:
      - ./wkcrm.sh:/wkcrm.sh
      - ./log/wkcrm:/opt/package/logs/
      - ./data/wkcrm/file:/opt/upload/
    ports:
      - "8443:8443"
    networks:
      wkcrm_network:
    entrypoint: /wkcrm.sh restart
    restart: always

networks:
  wkcrm_network:
    external:
      name: wkcrm_network
