网关部署环境
This commit is contained in:
parent
eb0fda80f2
commit
be73b6f143
@ -2,9 +2,15 @@
|
||||
# 使用官方Eclipse Temurin镜像作为基础镜像(JDK17兼容Spring Boot 3.x)
|
||||
FROM eclipse-temurin:17-jdk-jammy
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 创建日志目录
|
||||
RUN mkdir -p /app/logs && chmod 755 /app/logs
|
||||
|
||||
VOLUME /opt/docker-images
|
||||
|
||||
ADD ebike-gather-0.0.1-SNAPSHOT.jar /ebike-gather.jar
|
||||
ADD ebike-gather-0.0.1-SNAPSHOT.jar /app/ebike-gather.jar
|
||||
|
||||
|
||||
# 设置JVM参数(根据实际需求调整)
|
||||
|
||||
@ -3,6 +3,9 @@ package org.cdzy.gather;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @author attiya
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class EbikeGatherApplication {
|
||||
|
||||
|
||||
@ -1,3 +1,53 @@
|
||||
server:
|
||||
port: 10011
|
||||
servlet:
|
||||
context-path: /gather
|
||||
spring:
|
||||
application:
|
||||
name: ebike-gather
|
||||
name: ebike-gather
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 47.109.141.125:8848 # nacos
|
||||
username: nacos
|
||||
password: nacos
|
||||
kafka:
|
||||
bootstrap-servers: 47.109.141.125:9092
|
||||
producer:
|
||||
retries: 0
|
||||
key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||
value-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||
consumer:
|
||||
group-id: gather-group
|
||||
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||
listener:
|
||||
missing-topics-fatal: false
|
||||
mqtt:
|
||||
host: 47.109.141.125
|
||||
port: 1883
|
||||
username: admin
|
||||
password: admin970529
|
||||
auto-subscribe-topics: ecu/rpt/#,ecu/rsp/#
|
||||
timeout: 10 # 减少超时时间以便更快失败
|
||||
clean-session: true
|
||||
keep-alive: 60
|
||||
pool:
|
||||
max-total: 10 # 暂时减少连接数
|
||||
max-idle: 5
|
||||
min-idle: 2 # 暂时减少最小空闲数
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: /app/logs/${spring.application.name}.log
|
||||
pattern:
|
||||
dateformat: yyyy-MM-dd HH:mm:ss.SSS # 包含毫秒
|
||||
@ -1,12 +1,135 @@
|
||||
server:
|
||||
port: 10012
|
||||
servlet:
|
||||
context-path: /user
|
||||
port: 10013
|
||||
spring:
|
||||
application:
|
||||
name: ebike-user
|
||||
name: ebike-operations
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30MB
|
||||
max-request-size: 100MB
|
||||
file-size-threshold: 0B
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 192.168.2.226:8848 # nacos
|
||||
server-addr: 127.0.0.1:8848 # nacos
|
||||
username: nacos
|
||||
password: nacos
|
||||
password: nacos
|
||||
kafka:
|
||||
bootstrap-servers: 192.168.1.11:9092
|
||||
producer:
|
||||
retries: 0
|
||||
key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||
value-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||
consumer:
|
||||
group-id: operations-group-${random.uuid}
|
||||
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||
listener:
|
||||
missing-topics-fatal: false
|
||||
sql:
|
||||
init:
|
||||
platform: postgis
|
||||
mode: never
|
||||
schema-locations: classpath:db/init.sql
|
||||
data-locations: classpath:db/data.sql
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: false
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
datasource:
|
||||
url: jdbc:postgresql://47.109.71.130:5432/ebike_operations?currentSchema=public&stringtype=unspecified
|
||||
username: root
|
||||
password: 970529
|
||||
driver-class-name: org.postgresql.Driver
|
||||
hikari:
|
||||
## 最小空闲连接数量
|
||||
minimum-idle: 2
|
||||
## 空闲连接存活最大时间,默认600000(10分钟)
|
||||
idle-timeout: 180000
|
||||
## 连接池最大连接数,默认是10
|
||||
maximum-pool-size: 5
|
||||
## 数据库连接超时时间,默认30秒,即30000
|
||||
connection-timeout: 30000
|
||||
connection-test-query: SELECT 1
|
||||
##此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
|
||||
max-lifetime: 1800000
|
||||
data:
|
||||
# redis配置
|
||||
redis:
|
||||
# Redis数据库索引(默认为0)
|
||||
database: 1
|
||||
# Redis服务器地址
|
||||
host: 192.168.1.11
|
||||
# Redis服务器连接端口
|
||||
port: 6379
|
||||
# Redis服务器连接密码(默认为空)
|
||||
password: 970529
|
||||
# 连接超时时间
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池最大连接数
|
||||
max-active: 200
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 10
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
mybatis-flex:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-handlers-package: com.cdzy.operations.handler
|
||||
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
||||
sa-token:
|
||||
# token 名称(同时也是 cookie 名称)
|
||||
token-name: Authorization
|
||||
# token 有效期(单位:秒) 默认30天,-1 代表永久有效
|
||||
timeout: 2592000
|
||||
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
|
||||
active-timeout: -1
|
||||
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
|
||||
is-share: true
|
||||
# token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
|
||||
token-style: random-32
|
||||
# 是否输出操作日志
|
||||
is-log: true
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
|
||||
emqx:
|
||||
api-url: http://47.109.71.130:18083/api/v5
|
||||
api-key: 684a5f936b784fe1
|
||||
api-secret: Jf3w3V9CbNsKcqTNkipVhfUGGurRPvCJknET2cs9CTKSI
|
||||
|
||||
minio:
|
||||
endpoint: http://47.109.141.125:9000 # MinIO服务器地址
|
||||
access-key: ZIF4HF1LXH0RTB9MZ52O # 访问密钥
|
||||
secret-key: YuFoH+VJVzQbNLRqVMo39dM5pWXCEcMvrCrtgwB0 # 私有密钥
|
||||
bucket-name: operations-objects
|
||||
show-url: https://www.cdzhuojing.cn/file
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: logs/${spring.application.name}.log
|
||||
pattern:
|
||||
dateformat: yyyy-MM-dd HH:mm:ss.SSS # 包含毫秒
|
||||
geo-coding:
|
||||
api-url: https://restapi.amap.com/v3/geocode
|
||||
access-key: c9bc51e353b49acd42a560f37121929a
|
||||
|
||||
wechat:
|
||||
qr-url: https://www.cdzhuojing.cn/ebike?bikeCode=
|
||||
|
||||
influxdb:
|
||||
url: http://47.109.71.130:8086
|
||||
token: -bbo5zEJ7NIZyZk4uwOg1Y9XVS5pXHhyBWvH7Y0VNp0lMpGizWnFPiGLzgmZeDm_kNj1pnJRgjXFbs1FKszk7w==
|
||||
org: admin
|
||||
bucket: gps
|
||||
@ -2,9 +2,15 @@
|
||||
# 使用官方Eclipse Temurin镜像作为基础镜像(JDK17兼容Spring Boot 3.x)
|
||||
FROM eclipse-temurin:17-jdk-jammy
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 创建日志目录
|
||||
RUN mkdir -p /app/logs && chmod 755 /app/logs
|
||||
|
||||
VOLUME /opt/docker-images
|
||||
|
||||
ADD ebike-staff-0.0.1-SNAPSHOT.jar /ebike-staff.jar
|
||||
ADD ebike-staff-0.0.1-SNAPSHOT.jar /app/ebike-staff.jar
|
||||
|
||||
|
||||
# 设置JVM参数(根据实际需求调整)
|
||||
|
||||
@ -1,12 +1,109 @@
|
||||
server:
|
||||
port: 10012
|
||||
servlet:
|
||||
context-path: /user
|
||||
spring:
|
||||
application:
|
||||
name: ebike-user
|
||||
name: ebike-staff
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30MB
|
||||
max-request-size: 100MB
|
||||
file-size-threshold: 0B
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 192.168.2.226:8848 # nacos
|
||||
server-addr: 47.109.141.125:8848 # nacos
|
||||
username: nacos
|
||||
password: nacos
|
||||
password: 970529
|
||||
sql:
|
||||
init:
|
||||
platform: postgis
|
||||
mode: never
|
||||
schema-locations: classpath:db/init.sql
|
||||
data-locations: classpath:db/data.sql
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: false
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
datasource:
|
||||
url: jdbc:postgresql://47.109.141.125:5432/ebike_staff?currentSchema=public&stringtype=unspecified
|
||||
username: root
|
||||
password: Cdzj1234
|
||||
driver-class-name: org.postgresql.Driver
|
||||
hikari:
|
||||
## 最小空闲连接数量
|
||||
minimum-idle: 2
|
||||
## 空闲连接存活最大时间,默认600000(10分钟)
|
||||
idle-timeout: 180000
|
||||
## 连接池最大连接数,默认是10
|
||||
maximum-pool-size: 5
|
||||
## 数据库连接超时时间,默认30秒,即30000
|
||||
connection-timeout: 30000
|
||||
connection-test-query: SELECT 1
|
||||
##此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
|
||||
max-lifetime: 1800000
|
||||
data:
|
||||
# redis配置
|
||||
redis:
|
||||
# Redis数据库索引(默认为0)
|
||||
database: 1
|
||||
# Redis服务器地址
|
||||
host: 47.109.141.125
|
||||
# Redis服务器连接端口
|
||||
port: 6379
|
||||
# Redis服务器连接密码(默认为空)
|
||||
password: 970529
|
||||
# 连接超时时间
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池最大连接数
|
||||
max-active: 200
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 10
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
|
||||
mybatis-flex:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
||||
sa-token:
|
||||
# token 名称(同时也是 cookie 名称)
|
||||
token-name: Authorization
|
||||
# token 有效期(单位:秒) 默认30天,-1 代表永久有效
|
||||
timeout: 2592000
|
||||
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
|
||||
active-timeout: -1
|
||||
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
|
||||
is-share: true
|
||||
# token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
|
||||
token-style: random-32
|
||||
# 是否输出操作日志
|
||||
is-log: true
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: /app/logs/${spring.application.name}.log
|
||||
pattern:
|
||||
dateformat: yyyy-MM-dd HH:mm:ss.SSS # 包含毫秒
|
||||
|
||||
|
||||
minio:
|
||||
endpoint: http://47.109.141.125:9000 # MinIO服务器地址
|
||||
access-key: ZIF4HF1LXH0RTB9MZ52O # 访问密钥
|
||||
secret-key: YuFoH+VJVzQbNLRqVMo39dM5pWXCEcMvrCrtgwB0 # 私有密钥
|
||||
bucket-name: static-objects
|
||||
show-url: https://www.cx.cdzhuojing.cn/file
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user