update 优化 docker 部署方式 使用 host 模式简化部署流程 降低使用成本

2.X
疯狂的狮子li 3 years ago
parent abeec6ddea
commit 93e52ae6ac

@ -18,7 +18,7 @@ store.publicKey=
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.cj.jdbc.Driver
store.db.url=jdbc:mysql://172.30.0.36:3306/ry-seata?useUnicode=true&rewriteBatchedStatements=true
store.db.url=jdbc:mysql://127.0.0.1:3306/ry-seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=root
store.db.password=root
store.db.minConn=5

@ -26,10 +26,7 @@ services:
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.36
network_mode: "host"
nacos:
image: nacos/nacos-server:v2.1.0
@ -42,7 +39,7 @@ services:
TZ: Asia/Shanghai
MODE: standalone
SPRING_DATASOURCE_PLATFORM: mysql
MYSQL_SERVICE_HOST: 172.30.0.36
MYSQL_SERVICE_HOST: 127.0.0.1
MYSQL_SERVICE_PORT: 3306
MYSQL_SERVICE_USER: root
MYSQL_SERVICE_PASSWORD: ruoyi123
@ -52,10 +49,7 @@ services:
- /docker/nacos/logs/:/home/nacos/logs
- /docker/nacos/config/custom.properties:/home/nacos/init.d/custom.properties
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.40
network_mode: "host"
redis:
image: redis:6.2.7
@ -72,10 +66,7 @@ services:
- /docker/redis/data/:/redis/data/
command: "redis-server /redis/config/redis.conf"
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.48
network_mode: "host"
minio:
image: minio/minio:RELEASE.2022-05-26T05-48-41Z
@ -107,10 +98,7 @@ services:
- /docker/minio/config:/root/.minio/
command: server --address ':9000' --console-address ':9001' /data # 指定容器中的目录 /data
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.54
network_mode: "host"
seata-server:
image: ruoyi/ruoyi-seata-server:1.0.0
@ -126,9 +114,7 @@ services:
volumes:
- /docker/ruoyi-seata-server/logs/:/ruoyi/seata-server/logs
privileged: true
restart: always
networks:
- ruoyi_net
network_mode: "host"
nginx-web:
image: nginx:1.21.6
@ -149,9 +135,7 @@ services:
# 日志目录
- /docker/nginx/log:/var/log/nginx
privileged: true
restart: always
networks:
- ruoyi_net
network_mode: "host"
sentinel:
image: ruoyi/ruoyi-sentinel-dashboard:1.0.0
@ -164,9 +148,7 @@ services:
# 配置文件
- /docker/ruoyi-sentinel-dashboard/logs/:/ruoyi/sentinel-dashboard/logs
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.68
network_mode: "host"
ruoyi-monitor-admin:
image: ruoyi/ruoyi-monitor:1.0.0
@ -180,10 +162,7 @@ services:
# 配置文件
- /docker/ruoyi-monitor/logs/:/ruoyi/monitor/logs
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.90
network_mode: "host"
ruoyi-xxl-job-admin:
image: ruoyi/ruoyi-xxl-job-admin:1.0.0
@ -197,10 +176,7 @@ services:
# 配置文件
- /docker/ruoyi-xxl-job-admin/logs/:/ruoyi/xxl-job-admin/logs
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.92
network_mode: "host"
ruoyi-gateway:
image: ruoyi/ruoyi-gateway:1.0.0
@ -214,10 +190,7 @@ services:
# 配置文件
- /docker/ruoyi-gateway/logs/:/ruoyi/gateway/logs
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.100
network_mode: "host"
ruoyi-auth:
image: ruoyi/ruoyi-auth:1.0.0
@ -231,10 +204,7 @@ services:
# 配置文件
- /docker/ruoyi-auth/logs/:/ruoyi/auth/logs
privileged: true
restart: always
networks:
ruoyi_net:
ipv4_address: 172.30.0.110
network_mode: "host"
ruoyi-system:
image: ruoyi/ruoyi-system:1.0.0
@ -248,9 +218,7 @@ services:
# 配置文件
- /docker/ruoyi-system/logs/:/ruoyi/system/logs
privileged: true
restart: always
networks:
- ruoyi_net
network_mode: "host"
ruoyi-gen:
image: ruoyi/ruoyi-gen:1.0.0
@ -264,9 +232,7 @@ services:
# 配置文件
- /docker/ruoyi-gen/logs/:/ruoyi/gen/logs
privileged: true
restart: always
networks:
- ruoyi_net
network_mode: "host"
ruoyi-job:
image: ruoyi/ruoyi-job:1.0.0
@ -280,9 +246,7 @@ services:
# 配置文件
- /docker/ruoyi-job/logs/:/ruoyi/job/logs
privileged: true
restart: always
networks:
- ruoyi_net
network_mode: "host"
ruoyi-resource:
image: ruoyi/ruoyi-resource:1.0.0
@ -296,13 +260,4 @@ services:
# 配置文件
- /docker/ruoyi-resource/logs/:/ruoyi/resource/logs
privileged: true
restart: always
networks:
- ruoyi_net
networks:
ruoyi_net:
driver: bridge
ipam:
config:
- subnet: 172.30.0.0/16
network_mode: "host"

@ -24,8 +24,8 @@ http {
upstream server {
ip_hash;
# gateway 地址
server 172.30.0.100:8080;
# server 172.30.0.101:8080;
server 127.0.0.1:8080;
# server 127.0.0.1:8081;
}
server {

@ -8,8 +8,10 @@ RUN mkdir -p /ruoyi/auth/temp
WORKDIR /ruoyi/auth
EXPOSE 9200
ENV SERVER_PORT=9200
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-auth.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dserver.port=${SERVER_PORT}", "-jar", "app.jar"]

@ -8,8 +8,10 @@ RUN mkdir -p /ruoyi/gateway/temp
WORKDIR /ruoyi/gateway
EXPOSE 8080
ENV SERVER_PORT=9200
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-gateway.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dserver.port=${SERVER_PORT}", "-jar", "app.jar"]

@ -7,8 +7,10 @@ RUN mkdir -p /ruoyi/gen/logs
WORKDIR /ruoyi/gen
EXPOSE 9202
ENV SERVER_PORT=9202
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-gen.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dserver.port=${SERVER_PORT}", "-jar", "app.jar"]

@ -8,8 +8,10 @@ RUN mkdir -p /ruoyi/job/temp
WORKDIR /ruoyi/job
EXPOSE 9203
ENV SERVER_PORT=9203
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-job.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dserver.port=${SERVER_PORT}", "-jar", "app.jar"]

@ -8,8 +8,10 @@ RUN mkdir -p /ruoyi/resource/temp
WORKDIR /ruoyi/resource
EXPOSE 9300
ENV SERVER_PORT=9300
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-resource.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dserver.port=${SERVER_PORT}", "-jar", "app.jar"]

@ -8,8 +8,10 @@ RUN mkdir -p /ruoyi/system/temp
WORKDIR /ruoyi/system
EXPOSE 9201
ENV SERVER_PORT=9201
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-system.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dserver.port=${SERVER_PORT}", "-jar", "app.jar"]

Loading…
Cancel
Save