配置docker-compose.yaml文件

Posted 小叩

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置docker-compose.yaml文件相关的知识,希望对你有一定的参考价值。

注意版本,端口(本人只配置了mysql、nacos、sentinel、portainer、seata、rabbitmq、xxl-job-admin)

version: "3"	
networks:
    traefik:
        external: true
services:
  mysql:
    container_name: mysql
    image: mysql:5.7
    environment:
      - MYSQL_ROOT_PASSWORD=123456
    volumes:
      - /app/cloud/mysql/data:/var/lib/mysql
    ports:
      - "3306:3306"
    restart: always

  nacos:
    image: nacos/nacos-server:1.4.1
    container_name: nacos
    hostname: nacos
    restart: always
    environment:
      - MODE=standalone
      - TZ=Asia/Shanghai
      - NACOS_SERVER_PORT=8848
      - SPRING_DATASOURCE_PLATFORM=mysql
      - MYSQL_SERVICE_HOST=192.168.131.131
      - MYSQL_SERVICE_PORT=3306
      - MYSQL_SERVICE_DB_NAME=nacos_config
      - MYSQL_SERVICE_USER=root
      - MYSQL_SERVICE_PASSWORD=123456
      - PREFER_HOST_MODE=hostname
    volumes:
      - /app/cloud/nacos/logs:/home/nacos/logs
    ports:
      - "8848:8848"
  sentinel:
    image: bladex/sentinel-dashboard:1.8.0
    container_name: sentinel
    ports:
      - "8858:8858"
    restart: always

  portainer:
    image: portainer/portainer  # 官方版
    container_name: portainer
    restart: always
    ports:
      - "9000:9000"
    volumes:
      - ./data:/data
      - /var/run/docker.sock:/var/run/docker.sock


  seata-server:
    image: seataio/seata-server:1.3.0
    hostname: seata-server
    ports:
      - 8091:8091
    environment:
      - SEATA_PORT=8091
      - STORE_MODE=file
    expose:
      - 8091

  rabbitmq:
    hostname: rabbitmq
    environment:
      RABBITMQ_DEFAULT_VHOST: "root"
      RABBITMQ_DEFAULT_USER: "root"
      RABBITMQ_DEFAULT_PASS: "123456"
    image: "rabbitmq:3.9.14-management"
    restart: always
    volumes:
      - "/usr/local/bank/rabbitmq/data:/var/lib/rabbitmq"
      - "/usr/local/bank/rabbitmq/log:/var/lib/rabbitmq/log"
    ports:
      - "15672:15672"
      - "4369:4369"
      - "5672:5672"
      - "25672:25672"

  xxl-job-admin:
    restart: always
    # docker 镜像
    image: xuxueli/xxl-job-admin:2.3.1
    # 容器名称
    container_name: xxl-job-admin
    volumes:
      # 日志目录映射到主机目录
      - /data/xxl-job-admin/logs:/data/applogs
    ports:
      # 端口映射
      - "8800:8800"
    environment:
      # 设置启动参数
      PARAMS: '
      --server.port=8800
      --server.servlet.context-path=/xxl-job-admin
      --spring.datasource.url=jdbc:mysql://192.168.131.131/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
      --spring.datasource.username=root
      --spring.datasource.password=123456
      --spring.mail.host=smtp.qq.com
      --spring.mail.port=465
      --spring.mail.username=test_mail@qq.com
      --spring.mail.from=test_mail@qq.com
      --spring.mail.password=password123456
      --spring.mail.properties.mail.smtp.starttls.enable=true
      --spring.mail.properties.mail.smtp.starttls.required=true
      --xxl.job.accessToken=default_token
      --xxl.job.i18n=zh_CN
      --xxl.job.triggerpool.fast.max=200
      --xxl.job.triggerpool.slow.max=100
      --xxl.job.logretentiondays=30'


以上是关于配置docker-compose.yaml文件的主要内容,如果未能解决你的问题,请参考以下文章

wekan 工具配置

将 Pulsar 和 Python 组合成 docker-compose.yaml

采用docker-compose搭建Elasticsearch集群

docker-compose yaml.parser.ParserError

docker-compose yaml mysql和wordpress 一行命令搞定~~~

docker-compose启动容器失败了怎么办