1 Star 0 Fork 0

爱写Bug的麦洛/docker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker-compose.yml 8.32 KB
一键复制 编辑 原始数据 按行查看 历史
爱写Bug的麦洛 提交于 2024-11-15 08:53 . feat:nacos配置优化
version : '3.8'
services:
milo-nacos:
#容器名称
container_name: nacos
#镜像
image: nacos/nacos-server:v2.2.3
build:
context: ./nacos
environment:
- MODE=standalone #单机模式启动
volumes:
- ./nacos/logs/:/home/nacos/logs
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
ports:
- "18848:8848"
- "9848:9848"
- "9849:9849"
#当前服务依赖于名为 milo-mysql-8.0 的服务,确保在启动当前服务之前,milo-mysql-8.0 服务已经启动
depends_on:
- milo-mysql-8.0
#当前服务将连接到名为 milo-network 的网络,以便与其他在同一网络中的服务进行通信
networks:
- milo-network
milo-mysql:
container_name: mysql
image: mysql:5.7
build:
context: ./mysql/mysql5.7
ports:
- "23306:3306"
volumes:
- ./mysql/mysql5.7/conf:/etc/mysql/conf.d
- ./mysql/mysql5.7/logs:/logs
- ./mysql/mysql5.7/data:/var/lib/mysql
command: [
'mysqld',
'--innodb-buffer-pool-size=80M',
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci',
'--default-time-zone=+8:00',
'--lower-case-table-names=1'
]
environment:
MYSQL_DATABASE: 'ry-cloud'
MYSQL_ROOT_PASSWORD: password
milo-mysql-8.0:
# 镜像名
image: mysql:8.0.21
# 容器名(以后的控制都通过这个)
container_name: milo-mysql-8.0
# 重启策略
#restart: always
environment:
# 时区上海
TZ: Asia/Shanghai
# root 密码
MYSQL_ROOT_PASSWORD: Milo@2023
# 初始化数据库(后续的初始化sql会在这个库执行)
MYSQL_DATABASE: nacos_config
# 初始化用户(不能是root 会报错, 后续需要给新用户赋予权限)
MYSQL_USER: nacos
# 用户密码
MYSQL_PASSWORD: Milo@2023
# 映射端口
ports:
- 33306:3306
volumes:
# 数据挂载
- ./mysql/mysql8.0/data/:/var/lib/mysql/
# 配置挂载
- ./mysql/mysql8.0/conf/:/etc/mysql/conf.d/
# 初始化目录挂载
- ./mysql/mysql8.0/init/:/docker-entrypoint-initdb.d/
command:
# 将mysql8.0默认密码策略 修改为 原先 策略 (mysql8.0对其默认策略做了更改 会导致密码无法匹配)
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--skip-name-resolve
networks:
- milo-network
milo-redis:
container_name: redis
image: redis
build:
context: ./redis
ports:
- "16379:6379"
volumes:
- ./redis/conf/redis.conf:/home/milo/redis/redis.conf
- ./redis/data:/data
command: redis-server /home/milo/redis/redis.conf
milo-nginx:
container_name: nginx
image: nginx
build:
context: ./nginx
ports:
- "80:80"
# 部署服务时候打开注释内容
volumes:
#- ./nginx/html/dist:/home/milo/projects/milo-ui
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/logs:/var/log/nginx
- ./nginx/conf.d:/etc/nginx/conf.d
#depends_on:
#- milo-gateway
#links:
#- milo-gateway
# milo-rmqnamesrv 服务配置
milo-rmqnamesrv:
# 使用 Apache RocketMQ 4.9.4 镜像
image: apache/rocketmq:4.9.4
# 容器名称
container_name: milo-rmqnamesrv
# 映射端口,将主机的 9876 端口映射到容器内的 9876 端口
ports:
- 9876:9876
# 挂载卷,将主机的 ./rocketmq/rmqnamesrv/logs 目录映射到容器内的 /home/rocketmq/logs 目录
volumes:
- ./rocketmq/rmqnamesrv/logs:/home/rocketmq/logs
# 环境变量配置
environment:
JAVA_OPT_EXT: "-Duser.home=/home/rocketmq -Xms512M -Xmx512M -Xmn128m"
# 容器启动命令
command: ["sh","mqnamesrv"]
# milo-broker 服务配置
milo-broker:
# 使用 Apache RocketMQ 4.9.4 镜像
image: apache/rocketmq:4.9.4
# 容器名称
container_name: milo-rmqbroker
# 映射端口
ports:
- 10909:10909
- 10911:10911
- 10912:10912
# 挂载卷,将本地文件夹映射到容器内
volumes:
- ./rocketmq/rmqbroker/logs:/home/rocketmq/logs
- ./rocketmq/rmqbroker/store:/home/rocketmq/store
- ./rocketmq/rmqbroker/brokerconf/broker.conf:/home/rocketmq/rocketmq-4.9.1/conf/broker.conf
# 链接到 milo-rmqnamesrv 服务
links:
- milo-rmqnamesrv:namesrv
# 环境变量配置
environment:
NAMESRV_ADDR: namesrv:9876
JAVA_OPT_EXT: "-Duser.home=/home/rocketmq -Xms512M -Xmx512M -Xmn128m"
# 容器启动命令
command: [ "sh","mqbroker","-c","../conf/broker.conf","autoCreateTopicEnable=true" ]
# milo-rmqdashboard 服务配置
milo-rmqdashboard:
# 使用最新版的 Apache RocketMQ Dashboard 镜像
image: apacherocketmq/rocketmq-dashboard:latest
# 容器名称
container_name: milo-rocketmq-dashboard
# 映射端口,将主机的 38080 端口映射到容器内的 8080 端口
ports:
- 38080:8080
# 环境变量配置,指定 RocketMQ 的 NameServer 地址
environment:
JAVA_OPTS: "-Drocketmq.namesrv.addr=namesrv:9876"
# 链接到 milo-rmqnamesrv 服务
links:
- milo-rmqnamesrv:namesrv
milo-rabbitmq:
container_name: rabbitmq
image: rabbitmq:3.8.14-management
hostname: rabbitmq_host
build:
context: ./rabbitmq
ports:
- "15672:15672"
- "5672:5672" # 项目连接端口
volumes:
- ${DATA_PATH_HOST}/rabbitmq/log:/var/log/rabbitmq #挂载 RabbitMQ日志
- ${DATA_PATH_HOST}/rabbitmq/data:/var/lib/rabbitmq #挂载 RabbitMQ数据
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: admin@2023
# 代码管理工具gitea[登录名:bigdata 密码:Bigdata@2022]
milo-gitea:
container_name: gitea
image: gitea/gitea:1.20.2
environment:
- USER_UID=1000 #在容器内运行 Gitea 的用户的 UID
- USER_GID=1000 #在容器内运行 Gitea 的用户的 GID(Unix 组 ID)
#已经在配置文件挂载,无需指定`
#- APP_NAME=MiloLee
#- DOMAIN=192.168.0.105
#- DB_TYPE=mysql
#- DB_HOST=192.168.150.1:23306
#- DB_NAME=gitea
#- DB_USER=root
#- DB_PASSWD=Bigdata@2022
restart: always
build:
context: ./gitea
volumes:
- ./gitea/conf/app.ini:./gitea/data/gitea/conf/app.ini # 挂载配置文件
- ./gitea/repositories:./gitea/data/git/repositories # 代码仓库挂载出来
- ./gitea/log:./gitea/data/gitea/log # 挂载日志
#- /etc/timezone:/etc/timezone:ro
#- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "222:22"
# jar包部署
milo-gateway:
container_name: gateway
build:
context: ./milo/gateway
dockerfile: dockerfile
ports:
- "8080:8080"
depends_on:
- milo-redis
links:
- milo-redis
milo-auth:
container_name: auth
build:
context: ./milo/auth
dockerfile: dockerfile
ports:
- "9200:9200"
depends_on:
- milo-redis
links:
- milo-redis
milo-modules-system:
container_name: modules-system
build:
context: ./milo/modules/system
dockerfile: dockerfile
ports:
- "9201:9201"
depends_on:
- milo-redis
- milo-mysql
links:
- milo-redis
- milo-mysql
milo-modules-gen:
container_name: modules-gen
build:
context: ./milo/modules/gen
dockerfile: dockerfile
ports:
- "9202:9202"
depends_on:
- milo-mysql
links:
- milo-mysql
milo-modules-job:
container_name: modules-job
build:
context: ./milo/modules/job
dockerfile: dockerfile
ports:
- "9203:9203"
depends_on:
- milo-mysql
links:
- milo-mysql
milo-modules-file:
container_name: modules-file
build:
context: ./milo/modules/file
dockerfile: dockerfile
ports:
- "9300:9300"
volumes:
- ./milo/uploadPath:/home/milo/uploadPath
milo-visual-monitor:
container_name: visual-monitor
build:
context: ./milo/visual/monitor
dockerfile: dockerfile
ports:
- "9100:9100"
#网络配置
networks:
milo-network:
driver: bridge
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/milobugs/docker.git
git@gitee.com:milobugs/docker.git
milobugs
docker
docker
master

搜索帮助