systemctl restart network
docker-compose
单独执行一个文件
docker-compose -f
version: '3'services:nacos-standalone:image: nacos/nacos-server:v2.3.1 container_name: nacos-standaloneenvironment:- PREFER_HOST_MODE=hostname- MODE=standalone- NACOS_AUTH_IDENTITY_KEY=serverIdentity- NACOS_AUTH_IDENTITY_VALUE=security- NACOS_AUTH_TOKEN=SecretKey012345678901234567890123456789012345678901234567890123456789volumes:- /docker/nacos/standalone-logs/:/home/nacos/logsports:- "8848:8848"- "9848:9848"network_mode: "host"privileged: truerestart: always xxl-job-admin:restart: always # docker 镜像 image: xuxueli/xxl-job-admin:2.4.0# 容器名称container_name: xxl-job-adminvolumes:# 日志目录映射到主机目录- /docker/xxj-job/data/logs:/data/applogsports:# 端口映射- "8800:8800"environment:# 设置启动参数PARAMS: '--server.port=8800--server.servlet.context-path=/xxl-job-admin--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai--spring.datasource.username=xxl-job--spring.datasource.password=yKnam2mYb82Dpf6N--spring.mail.username=xxxx@qq.com--spring.mail.password=xxxx--xxl.job.accessToken=onelovehzs888' #代码里面需要指定的tokenmysql:image: mysql:8.0.33container_name: mysqlenvironment:# 时区上海TZ: Asia/Shanghai# root 密码MYSQL_ROOT_PASSWORD: ruoyi123# 初始化数据库(后续的初始化sql会在这个库执行)MYSQL_DATABASE: roof-monitor-entports:- "3306:3306"volumes:# 数据挂载- /docker/mysql/data/:/var/lib/mysql/# 配置挂载- /docker/mysql/conf/:/etc/mysql/conf.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=1privileged: truenetwork_mode: "host"restart: alwaysnginx-web:image: nginx:1.23.4container_name: nginx-webenvironment:# 时区上海TZ: Asia/Shanghaiports:- "80:80"- "443:443"volumes:# 证书映射- /docker/nginx/cert:/etc/nginx/cert# 配置文件映射- /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf# 页面目录- /docker/nginx/html:/usr/share/nginx/html# 日志目录- /docker/nginx/log:/var/log/nginxprivileged: truenetwork_mode: "host"restart: alwaysredis:image: redis:6.2.12container_name: redisports:- "6379:6379"environment:# 时区上海TZ: Asia/Shanghaivolumes:# 配置文件- /docker/redis/conf:/redis/config:rw# 数据文件- /docker/redis/data/:/redis/data/:rwcommand: "redis-server /redis/config/redis.conf"privileged: truenetwork_mode: "host"restart: alwaysminio:image: minio/minio:RELEASE.2023-04-13T03-08-07Zcontainer_name: minioports:# api 端口- "9000:9000"# 控制台端口- "9001:9001"environment:# 时区上海TZ: Asia/Shanghai# 管理后台用户名MINIO_ROOT_USER: ruoyi# 管理后台密码,最小8个字符MINIO_ROOT_PASSWORD: ruoyi123# https需要指定域名#MINIO_SERVER_URL: "https://xxx.com:9000"#MINIO_BROWSER_REDIRECT_URL: "https://xxx.com:9001"# 开启压缩 on 开启 off 关闭MINIO_COMPRESS: "off"# 扩展名 .pdf,.doc 为空 所有类型均压缩MINIO_COMPRESS_EXTENSIONS: ""# mime 类型 application/pdf 为空 所有类型均压缩MINIO_COMPRESS_MIME_TYPES: ""volumes:# 映射当前目录下的data目录至容器内/data目录- /docker/minio/data:/data# 映射配置目录- /docker/minio/config:/root/.minio/command: server --address ':9000' --console-address ':9001' /data # 指定容器中的目录 /dataprivileged: truenetwork_mode: "host"restart: alwaysrabbitmq:image: rabbitmq:3.8-managementcontainer_name: rabbitmqports:- '5672:5672'volumes:- /docker/rabbit/data:/dataenvironment:- TZ=Asia/Shanghai- RABBITMQ_DEFAULT_VHOST=my_vhost- RABBITMQ_DEFAULT_USER=admin- RABBITMQ_DEFAULT_PASS=adminnetwork_mode: "host"privileged: truerestart: alwaysmongo:image: mongo:7.0container_name: mongoports:- '27017:27017'command: ["mongod", "--config", "/etc/mongo/mongod.conf"]volumes:- /docker/mongo:/etc/mongo- /docker/mongo/data/db:/data/dbenvironment:- TZ=Asia/Shanghai- MONGO_INITDB_ROOT_USERNAME=admin- MONGO_INITDB_ROOT_PASSWORD=ruoyi123network_mode: "host"privileged: truerestart: alwaysnexus3:image: sonatype/nexus3container_name: nexus3ports:- '10120:8081'volumes:- /docker/nexus/nexus-data:/nexus-data- /docker/nexus/nexus-logs:/nexus-logs- /etc/localtime:/etc/localtime network_mode: "host"privileged: truerestart: always
docker安装nexus
安装参考
docker run -d -p 8081:8081 --name nexus -v /your/nexus-data:/nexus-data -v /your/nexus-logs:/nexus-logs sonatype/nexus3`
默认密码 admin/admin123
报错
mkdir: cannot create directory '../sonatype-work/nexus3/log': Permission denied mkdir: cannot create directory '../sonatype-work/nexus3/tmp': Permission denied
赋权限
chown -R 200 /docker/nexus