fix(docker,test): 修复 Docker 构建和测试配置
- 更新 Dockerfile 使用本地编译的 jar 文件 - 修复 vite.config.ts 移除未使用的 lodash-es 依赖 - 更新测试密码为 Test@123
This commit is contained in:
@@ -1,41 +1,4 @@
|
||||
# 多阶段构建优化Dockerfile - 多模块项目
|
||||
FROM maven:3.9-eclipse-temurin-21 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 复制根POM和Maven包装器
|
||||
COPY pom.xml .
|
||||
COPY mvnw .
|
||||
COPY mvnw.cmd .
|
||||
COPY .mvn .mvn
|
||||
|
||||
# 复制所有子模块POM和源码
|
||||
COPY manage-common/pom.xml manage-common/
|
||||
COPY manage-db/pom.xml manage-db/
|
||||
COPY manage-sys/pom.xml manage-sys/
|
||||
COPY manage-gateway/pom.xml manage-gateway/
|
||||
COPY manage-notify/pom.xml manage-notify/
|
||||
COPY manage-file/pom.xml manage-file/
|
||||
COPY manage-audit/pom.xml manage-audit/
|
||||
COPY manage-app/pom.xml manage-app/
|
||||
|
||||
# 下载依赖(利用Docker缓存层)
|
||||
RUN ./mvnw dependency:go-offline -B
|
||||
|
||||
# 复制源码
|
||||
COPY manage-common/src manage-common/src
|
||||
COPY manage-db/src manage-db/src
|
||||
COPY manage-sys/src manage-sys/src
|
||||
COPY manage-gateway/src manage-gateway/src
|
||||
COPY manage-notify/src manage-notify/src
|
||||
COPY manage-file/src manage-file/src
|
||||
COPY manage-audit/src manage-audit/src
|
||||
COPY manage-app/src manage-app/src
|
||||
|
||||
# 构建manage-app模块
|
||||
RUN ./mvnw clean package -DskipTests -pl manage-app -am
|
||||
|
||||
# 运行时镜像
|
||||
# 简化Dockerfile - 使用本地编译好的jar文件
|
||||
FROM eclipse-temurin:21-jre-jammy
|
||||
|
||||
# 设置时区和语言环境
|
||||
@@ -49,7 +12,7 @@ RUN groupadd -r novalon && useradd -r -g novalon novalon
|
||||
WORKDIR /app
|
||||
|
||||
# 复制构建产物
|
||||
COPY --from=builder --chown=novalon:novalon /app/manage-app/target/*.jar app.jar
|
||||
COPY manage-app/target/manage-app-1.0.0.jar app.jar
|
||||
|
||||
# 设置JVM参数优化
|
||||
ENV JAVA_OPTS="-Xmx512m -Xms256m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
Reference in New Issue
Block a user