From 388199279a386212d9bb5b65d1e6f2da6d06eb0d Mon Sep 17 00:00:00 2001
From: Doubleyin <953994191@qq.com>
Date: Tue, 14 Oct 2025 20:32:28 +0800
Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BC=98=E5=8C=96=EF=BC=9A?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0Actuator=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5?=
=?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=B9=B6=E4=BC=98=E5=8C=96Docker=E9=83=A8?=
=?UTF-8?q?=E7=BD=B2=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
deploy.yml | 6 +++---
pom.xml | 16 ++++++++++++++++
src/main/resources/application.properties | 15 ++++-----------
3 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/deploy.yml b/deploy.yml
index 0117595..ec14839 100644
--- a/deploy.yml
+++ b/deploy.yml
@@ -7,7 +7,7 @@ services:
container_name: light-delivery-container
ports:
- "8080:8080"
- - "8443:8443"
+ - "8443:443" # 修改这行,将宿主机8443端口映射到容器443端口
environment:
- SPRING_DATASOURCE_PASSWORD=Hu@ng1998!
- KEY_STORE_PASSWORD=k7cP6QLgJDkX
@@ -23,11 +23,11 @@ services:
networks:
- light-network
healthcheck:
- test: ["CMD", "curl", "-f", "https://localhost:8443/actuator/health", "--insecure"]
+ test: ["CMD", "wget", "--no-check-certificate", "-qO-", "https://localhost:443/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
- start_period: 60s
+ start_period: 40s
networks:
light-network:
diff --git a/pom.xml b/pom.xml
index 5fe8f5d..84fbf34 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,6 +119,12 @@
true
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
org.springframework.boot
@@ -163,6 +169,16 @@
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 3.3.1
+
+ UTF-8
+
+
+
com.google.cloud.tools
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 7f6bb01..ad78ebb 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1,45 +1,38 @@
spring.application.name=Light
-# æå¡å¨ç«¯å£é
ç½®
server.port=443
-# SSLé
ç½®
server.ssl.key-store-type=JKS
server.ssl.key-store=/etc/ssl/certs/www.doubleyin.cn.jks
server.ssl.key-store-password=${KEY_STORE_PASSWORD}
-# --- MySQL Database Configuration (Remote Server) ---
spring.datasource.url=jdbc:mysql://115.190.121.151:3306/light_delivery?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
spring.datasource.username=double
spring.datasource.password=Hu@ng1998!
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
-# JPA / Hibernate Settings
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
-# For MySQL
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
-# HikariCP Connection Pool Settings
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=2
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.idle-timeout=600000
spring.datasource.hikari.max-lifetime=1800000
-# ------ WeChat Configuration ------
wx.appId=wx1b790fd953ac27bf
wx.secret=b38c40c89cc4954472fb45d1e7cc27a4
wx.token=huang1998
wx.aesKey=lwararkj1BgurX8Qown6yjGNsqd8dEIEddDnYN3iLgc
-# WeChat API URLs
wx.api.access-token-url=https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential
wx.api.code2session-url=https://api.weixin.qq.com/sns/jscode2session
-# Logging Configuration
logging.level.com.light.delivery=INFO
-# JWT Configuration
jwt.secret=lightDeliveryProdSecretKey
-jwt.expiration=86400
\ No newline at end of file
+jwt.expiration=86400
+
+management.endpoints.web.exposure.include=health,info
+management.endpoint.health.show-details=always
\ No newline at end of file