mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-14 13:50:25 +00:00
build docker 构建镜像相关配置, all on one相关配置优化
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,8 +1,8 @@
|
||||
# java8基础镜像
|
||||
FROM registry.cn-beijing.aliyuncs.com/xxm1995/java8
|
||||
# java21基础镜像
|
||||
FROM m.daocloud.io/docker.io/eclipse-temurin:21.0.4_7-jdk-alpine
|
||||
|
||||
# 作者信息
|
||||
MAINTAINER xxm1995@outlook.com
|
||||
MAINTAINER daxpay@daxpay.cn
|
||||
|
||||
# 时区设置
|
||||
ENV TZ=Asia/Shanghai
|
||||
@@ -20,10 +20,10 @@ ENV JAVA_ARGS=""
|
||||
WORKDIR /
|
||||
|
||||
# 端口暴露
|
||||
EXPOSE 9000
|
||||
EXPOSE 9999
|
||||
|
||||
# 添加执行jar包
|
||||
ADD daxpay-single-start/target/daxpay-start.jar dax-start.jar
|
||||
ADD daxpay-single-start/target/daxpay-server.jar daxpay-server.jar
|
||||
|
||||
# 执行启动命令
|
||||
CMD java $JAVA_OPTS -jar dax-start.jar
|
||||
CMD java $JAVA_OPTS -jar daxpay-server.jar
|
||||
|
@@ -1532,8 +1532,8 @@ CREATE TABLE `starter_file_platform` (
|
||||
-- ----------------------------
|
||||
-- Records of starter_file_platform
|
||||
-- ----------------------------
|
||||
INSERT INTO `starter_file_platform` VALUES (1000, 'local', '本地存储', 'http://127.0.0.1:9999', 0, 1811365615815487488, '2024-08-13 12:32:37', 1811365615815487488, '2024-10-06 17:17:39', 0);
|
||||
INSERT INTO `starter_file_platform` VALUES (2000, 'minio', 'minio存储', 'http://127.0.0.1:9002/daxpay', 1, 1811365615815487488, '2024-08-13 12:32:40', 1811365615815487488, '2024-10-06 17:17:39', 3);
|
||||
INSERT INTO `starter_file_platform` VALUES (1000, 'local', '本地存储', 'http://127.0.0.1:9999/storage', 1, 1811365615815487488, '2024-08-13 12:32:37', 1811365615815487488, '2024-10-06 17:17:39', 0);
|
||||
INSERT INTO `starter_file_platform` VALUES (2000, 'minio', 'minio存储', 'http://127.0.0.1:9002/daxpay', 0, 1811365615815487488, '2024-08-13 12:32:40', 1811365615815487488, '2024-10-06 17:17:39', 3);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for starter_file_upload_info
|
||||
|
@@ -13,7 +13,7 @@
|
||||
<groupId>org.dromara.daxpay</groupId>
|
||||
<artifactId>daxpay-single-server</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>3.0.0.beta1</version>
|
||||
<version>3.0.0.beta2</version>
|
||||
<description>daxpay服务端</description>
|
||||
|
||||
<properties>
|
||||
@@ -29,8 +29,8 @@
|
||||
<easypoi.version>4.5.0</easypoi.version>
|
||||
<minio.version>8.5.2</minio.version>
|
||||
|
||||
<bootx-platform.version>3.0.0.beta1</bootx-platform.version>
|
||||
<daxpay.version>3.0.0.beta1</daxpay.version>
|
||||
<bootx-platform.version>3.0.0.beta2</bootx-platform.version>
|
||||
<daxpay.version>3.0.0.beta2</daxpay.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -64,17 +64,16 @@
|
||||
</dependency>
|
||||
|
||||
<!-- 数据库驱动 PG -->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.postgresql</groupId>-->
|
||||
<!-- <artifactId>postgresql</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 数据库驱动 MySQL -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.mysql</groupId>-->
|
||||
<!-- <artifactId>mysql-connector-j</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--文件存储 (minio方式)-->
|
||||
<dependency>
|
||||
@@ -124,6 +123,8 @@
|
||||
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@@ -3,6 +3,7 @@ package org.dromara.daxpay;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
@@ -15,9 +16,26 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
public class FrontWebConfig implements WebMvcConfigurer {
|
||||
private final FrontH5Interceptor h5Interceptor;
|
||||
private final FrontWebInterceptor webInterceptor;
|
||||
|
||||
/**
|
||||
* 内嵌服务重定向
|
||||
*/
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(h5Interceptor).addPathPatterns("/h5/**");
|
||||
registry.addInterceptor(webInterceptor).addPathPatterns("/web/**");
|
||||
}
|
||||
|
||||
/**
|
||||
* 重写资源路径配置 (内嵌服务时使用)
|
||||
*/
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
// 移动端网页映射
|
||||
registry.addResourceHandler("/h5/**").addResourceLocations("classpath:/static/h5/");
|
||||
// 电脑端网页映射
|
||||
registry.addResourceHandler("/web/**").addResourceLocations("classpath:/static/web/");
|
||||
// 上传文件访问映射
|
||||
registry.addResourceHandler("/storage/**").addResourceLocations("file:/data/files/");
|
||||
}
|
||||
}
|
||||
|
@@ -5,15 +5,15 @@ spring:
|
||||
datasource:
|
||||
master:
|
||||
# Postgresql连接
|
||||
driver-class-name: org.postgresql.Driver
|
||||
url: jdbc:postgresql://postgresql:5432/dax-pay-single?serverTimezone=Asia/Shanghai&autoReconnect=true&reWriteBatchedInserts=true
|
||||
username: bootx
|
||||
password: bootx123
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://postgresql:5432/daxpay?serverTimezone=Asia/Shanghai&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: bootx
|
||||
# password: bootx123
|
||||
# MySQL连接
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://mysql/dax-pay-single?serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&useSSL=false&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: root
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://mysql:3306/dax-pay-single?serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root
|
||||
hikari:
|
||||
keepalive-time: 300000
|
||||
data:
|
||||
@@ -55,7 +55,10 @@ bootx-platform:
|
||||
- org.dromara.daxpay
|
||||
starter:
|
||||
auth:
|
||||
# 是否启用超级管理员登录
|
||||
enable-admin: true
|
||||
# 用户管理列表中是否显示超级管理员
|
||||
admin-in-list: true
|
||||
ignore-urls:
|
||||
- '/actuator/**'
|
||||
- '/v3/api-docs/**'
|
||||
@@ -71,9 +74,6 @@ bootx-platform:
|
||||
- '/css/**'
|
||||
- '/error'
|
||||
- '/favicon.ico'
|
||||
file-upload:
|
||||
# 使用后端代理访问, 线上请使用 Nginx 配置或者直连方式,效率更高
|
||||
forward-server-url: http://127.0.0.1:9999
|
||||
dax-pay:
|
||||
# 推荐只使用字母和数字, 特殊符号会导致部分通道出问题
|
||||
env: DEV
|
||||
|
@@ -4,19 +4,19 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
# Postgresql连接
|
||||
driver-class-name: org.postgresql.Driver
|
||||
url: jdbc:postgresql://127.0.0.1:5432/dax-pay-single-demo?serverTimezone=Asia/Shanghai&autoReconnect=true&reWriteBatchedInserts=true
|
||||
username: bootx
|
||||
password: bootx123
|
||||
# MySQL连接
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: ${MYSQL_URL}
|
||||
username: ${MYSQL_USERNAME}
|
||||
password: ${MYSQL_PASSWORD}
|
||||
hikari:
|
||||
keepalive-time: 300000
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
database: 14
|
||||
password: bootx123
|
||||
host: ${REDIS_HOST}
|
||||
port: ${REDIS_PORT}
|
||||
database: ${REDIS_DATABASE}
|
||||
password: ${REDIS_PASSWORD}
|
||||
lettuce:
|
||||
pool:
|
||||
max-wait: 1000ms
|
||||
@@ -26,8 +26,8 @@ springdoc:
|
||||
default-flat-param-object: true
|
||||
knife4j:
|
||||
enable: true
|
||||
# 关闭swagger接口
|
||||
production: true
|
||||
# 为true 关闭swagger接口
|
||||
production: ${KNIFE4J_PRODUCTION:false}
|
||||
# 基础脚手架配置
|
||||
bootx-platform:
|
||||
common:
|
||||
@@ -50,26 +50,32 @@ bootx-platform:
|
||||
starter:
|
||||
auth:
|
||||
# 是否启用超级管理员登录
|
||||
enable-admin: false
|
||||
enable-admin: ${DAXPAY_ENABLE_ADMIN:true}
|
||||
# 用户管理列表中是否显示超级管理员
|
||||
admin-in-list: false
|
||||
admin-in-list: ${DAXPAY_ADMIN-IN-LIST:true}
|
||||
ignore-urls:
|
||||
- '/actuator/**'
|
||||
- '/swagger-resources/**'
|
||||
- '/token/**'
|
||||
- '/ws/**'
|
||||
- '/v3/api-docs/**'
|
||||
- '/doc.html'
|
||||
- '/swagger-resources/**'
|
||||
- '/webjars/**'
|
||||
- '/storage/**'
|
||||
- '/web/**'
|
||||
- '/h5/**'
|
||||
- '/css/**'
|
||||
- '/error'
|
||||
- '/favicon.ico'
|
||||
file-upload:
|
||||
# 使用后端代理访问, 线上请使用 Nginx 配置或者直连方式,效率更高
|
||||
forward-server-url: http://127.0.0.1:9999
|
||||
audit-log:
|
||||
ip2region:
|
||||
# 默认使用索引模式
|
||||
search-type: vector_index
|
||||
# 文件存储地址
|
||||
file-path: /data/ip2region/ip2region.xdb
|
||||
dax-pay:
|
||||
# 推荐只使用字母和数字, 特殊符号会导致部分通道出问题
|
||||
env: DEMO
|
||||
env: DAX
|
||||
machine-no: 70
|
||||
dromara:
|
||||
# 注意, 不要设置 domain 访问路径, 自行进行拼接访问路径, 来保证可迁移性
|
||||
@@ -82,12 +88,3 @@ dromara:
|
||||
enable-storage: true
|
||||
base-path: /file/ # 基基础存储路径 前缀和结尾都必须为 /
|
||||
storage-path: /data/files/ # 存储路径, 结尾必须为 /
|
||||
# 例如 minio地址 http://127.0.0.1:9002 桶名称 daxpay, 拼接后的地址为 http://127.0.0.1:9002/daxpay/
|
||||
minio:
|
||||
- platform: minio
|
||||
enable-storage: true
|
||||
access-key: yDAArSoyQAligC2IGf7C
|
||||
secret-key: vDgpt5R4kR2UCapMzx32Rb6qZegok21dRsU6XJ1j
|
||||
end-point: http://127.0.0.1:9002 # minio访问地址
|
||||
bucket-name: daxpay # 存储桶名称
|
||||
base-path: /file/ # 基础存储路径 前缀和结尾都必须为 /
|
@@ -4,7 +4,6 @@
|
||||
默认情况下,Spring Boot 不会 在 jar 文件之外寻找资源。
|
||||
如果你想使用外部 logback 配置文件,你必须在启动 jar 时传递它的位置:$ java -jar -Dlogging.config=./logback-spring.xml app.jar
|
||||
-->
|
||||
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
<!--项目名称-->
|
||||
<property name="appname" value="dax-pay-server"/>
|
||||
@@ -18,9 +17,24 @@
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- log格式日志收集 -->
|
||||
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<File>${logdir}/${appname}.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<FileNamePattern>${logdir}/${appname}.log.%d{yyyy-MM-dd}.gz</FileNamePattern>
|
||||
<!-- 保存30天 -->
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%date{yyyy-MM-dd HH:mm:ssS} | %-5level[%X{traceId:-}] %thread - %logger{36}| %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 开发输出级别 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="console"/>
|
||||
<appender-ref ref="file"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
|
@@ -4,7 +4,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 通道认证状态
|
||||
* 认证结果状态
|
||||
* @author xxm
|
||||
* @since 2024/9/24
|
||||
*/
|
||||
|
@@ -4,7 +4,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 支付签名类型
|
||||
* 签名类型
|
||||
* 字典 sign_type
|
||||
* @author xxm
|
||||
* @since 2023/12/24
|
||||
|
@@ -69,13 +69,6 @@ public class CheckoutCreatParam extends PaymentCommonParam {
|
||||
@Digits(integer = 8, fraction = 2, message = "支付金额精度到分, 且要小于一亿元")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 支付扩展参数
|
||||
*/
|
||||
@Schema(description = "支付扩展参数")
|
||||
@Size(max = 2048, message = "支付扩展参数不可超过2048位")
|
||||
private String extraParam;
|
||||
|
||||
/** 商户扩展参数,回调时会原样返回 */
|
||||
@Schema(description = "商户扩展参数")
|
||||
@Size(max = 500, message = "商户扩展参数不可超过500位")
|
||||
|
@@ -127,6 +127,10 @@ public class CheckoutAssistService {
|
||||
.setStatus(PayStatusEnum.WAIT.getCode())
|
||||
.setRefundStatus(PayRefundStatusEnum.NO_REFUND.getCode())
|
||||
.setExpiredTime(expiredTime)
|
||||
.setAttach(checkoutParam.getAttach())
|
||||
.setReqTime(checkoutParam.getReqTime())
|
||||
.setNotifyUrl(checkoutParam.getNotifyUrl())
|
||||
.setReturnUrl(checkoutParam.getReturnUrl())
|
||||
.setRefundableBalance(checkoutParam.getAmount());
|
||||
// 如果支持分账, 设置分账状态为待分账
|
||||
if (order.getAllocation()) {
|
||||
|
@@ -1,15 +1,38 @@
|
||||
version: '3'
|
||||
services:
|
||||
platform:
|
||||
image: dax-start:latest
|
||||
daxpay-single:
|
||||
image: daxpay/daxpay-single:3.0.0.beta2
|
||||
restart: always
|
||||
ports:
|
||||
- "9000:9000"
|
||||
volumes:
|
||||
# window上不支持host网络模式, 需要更改为 bridge 网络模式, 然后走端口映射
|
||||
network_mode: host
|
||||
# 如果不可以使用host网络模式时使用这个, 此时数据库相关的连接地址将不可以使用 127.0.0.1
|
||||
# ports:
|
||||
# 端口映射 外部端口:容器端口
|
||||
# - "9999:9999"
|
||||
# 读取外部化配置文件(根据实际服务器环境做修改), 宿主机目录:容器目录
|
||||
- ./logs/:/logs # 日志
|
||||
- ./files/:/data/files # 上传文件目录
|
||||
- ./application.yml:/application.yml # 启动配置文件
|
||||
- ./application-demo.yml:/application-demo.yml
|
||||
- ./logback-spring.xml:/logback-spring.xml # 日志框架配置
|
||||
- ./ip2region/ip2region.xdb :/data/ip2region/ip2region.xdb # ip归属地数据库
|
||||
volumes:
|
||||
# 日志
|
||||
- ./data/logs/:/logs
|
||||
# 上传文件目录
|
||||
- ./data/files/:/data/files
|
||||
environment:
|
||||
# mysql数据库连接地址
|
||||
- MYSQL_URL=jdbc:mysql://127.0.0.1:3306/dax-pay-single?serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
# mysql数据库账号
|
||||
- MYSQL_USERNAME=root
|
||||
# mysql数据库密码
|
||||
- MYSQL_PASSWORD=root
|
||||
# Redis 连接地址
|
||||
- REDIS_HOST=127.0.0.1
|
||||
# Redis 端口
|
||||
- REDIS_PORT=6379
|
||||
# Redis 库号
|
||||
- REDIS_DATABASE=5
|
||||
# Redis 密码, 如果不设置密码则留空
|
||||
- REDIS_PASSWORD=daxpay
|
||||
# 是否关闭swagger接口
|
||||
- KNIFE4J_PRODUCTION=false
|
||||
# 是否启用超级管理员登录, 正式环境不要开启
|
||||
- DAXPAY_ENABLE_ADMIN=true
|
||||
# 用户管理列表中是否显示超级管理员
|
||||
- DAXPAY_ADMIN-IN-LIST=true
|
||||
|
Reference in New Issue
Block a user