chore: 优化部署配置

This commit is contained in:
MaDaLei 2026-04-17 13:43:34 +08:00
parent da64a495ac
commit 4c95bf585f
3 changed files with 59 additions and 2 deletions

View File

@ -0,0 +1,7 @@
# 反代到 Spring Boot 时加入server 或 location /api/ 内)
# 默认 client_max_body_size 仅 1m会导致大视频返回 HTTP 413小程序提示「文件过大」
client_max_body_size 200m;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;

View File

@ -0,0 +1,46 @@
# 复制为 application.yml 后填写本地/生产配置application.yml 已加入 .gitignore勿提交密钥
spring:
application:
name: petstore-backend
datasource:
url: jdbc:mysql://127.0.0.1:3306/petstore?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
password: ${MYSQL_PASSWORD:changeme}
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
max-lifetime: 1800000
connection-test-query: SELECT 1
validation-timeout: 3000
idle-timeout: 600000
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
dialect: org.hibernate.dialect.MySQLDialect
format_sql: true
servlet:
multipart:
max-file-size: 200MB
max-request-size: 200MB
server:
port: 8080
servlet:
context-path:
tomcat:
max-http-form-post-size: 200MB
max-swallow-size: 200MB
upload:
path: uploads
logging:
level:
com.petstore: debug
wechat:
appid: ${WECHAT_APPID:}
appsecret: ${WECHAT_APPSECRET:}
redirect_uri: http://localhost:8080/api/wechat/callback

View File

@ -21,13 +21,17 @@ spring:
format_sql: true
servlet:
multipart:
max-file-size: 120MB
max-request-size: 120MB
max-file-size: 200MB
max-request-size: 200MB
server:
port: 8080
servlet:
context-path:
# 与 multipart 一致,避免嵌入式 Tomcat 仍限制表单体积导致大视频 413
tomcat:
max-http-form-post-size: 200MB
max-swallow-size: 200MB
upload:
path: /www/petstore/uploads