潘志宝
7 天以前 161f558d30e64d40fe7552da16b4141859aa467e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
version: '1.0'
services:
  #项目名称,用docker-compose做管理时,每个项目用这里配置的名称进行单独管理
  ## mysql
  mysql-db:
    # 指定容器的名称
    container_name: mysql
    # 指定镜像和版本
    image: mysql:8.0
    ports:
      - "3306:3306"
    restart: always
    environment:
      # 配置root密码
      MYSQL_ROOT_PASSWORD: 123456
    volumes:
      # 挂载数据目录
      - "/sda2/mysql/data:/var/lib/mysql"
      # 挂载配置文件目录
      - "/sda2/mysql/conf:/etc/mysql/conf.d"
  ## redis
  redis:
    image: redis:latest
    container_name: redis
    restart: always
    ports:
      - 6379:6379
    volumes:
      - ./redis-data:/data:rw
  ## nacos
  nacos:
    # 根据需要修改版本
    image: nacos/nacos-server:2.3.2
    container_name: nacos-standalone
    restart: always
    environment:
      - PREFER_HOST_MODE=hostname
      - MODE=standalone
    volumes:
      - ./nacos/logs/:/home/nacos/logs
      - ./nacos/data/:/home/nacos/data
    ports:
      - "8848:8848"
    depends_on:
      - mysql
    healthcheck:
      test: ["CMD","curl","-f","http://localhost:8848/nacos"]
      interval: 10s
      timeout: 30s
      retries: 3
  ## xxl-job
  xxl-job:
    # 根据需要修改版本
    image: xxl-job:latest
    container_name: xxl-job
    restart: always
    volumes:
      - /sda2/iailab/iailab-plat/xxl-job/logs/:/data/applogs
    ports:
      - "9090:9090"
    depends_on:
      - mysql
#  gateway:
#    #镜像名,拉取镜像时也是用这个名字作为地址
#    image: ic-gateway
#    container_name: ic-gateway
#    #打包路径,即docker build的路径
#    build: ./api/gateway/
#    restart: always
#    #环境变量
#    environment:
#      CONFIG_SERVER: 172.19.188.43:8848           #配置中心地址
#    #挂载目录
#    volumes:
#      - /etc/localtime:/etc/localtime:ro            #时间同步
#      - ./api/gateway-lib:/home/beex-gateway/lib
#      - ./api/gateway/:/home/beex-gateway
#      - ./logs:/logs
#    #开放端口
#    ports:
#      - "9990:9000"
#      - "9777:8777"
#    networks:
#      - 246-multi-tenant
#    depends_on:
#      nacos:
#        condition: service_healthy
#    healthcheck:
#      test: ["CMD","curl","-S","http://localhost:9000/doc.html#/beex-api-gateway/authenticate-controller/authenticateUsingGET"]
#      interval: 20s
#      timeout: 30s
#      retries: 3
#      start_period: 20s