feat(db): 迁移数据库迁移脚本 V1-V5(任务 T1.1) #5
@@ -1,41 +1,4 @@
|
|||||||
# 多阶段构建优化Dockerfile - 多模块项目
|
# 简化Dockerfile - 使用本地编译好的jar文件
|
||||||
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
|
|
||||||
|
|
||||||
# 运行时镜像
|
|
||||||
FROM eclipse-temurin:21-jre-jammy
|
FROM eclipse-temurin:21-jre-jammy
|
||||||
|
|
||||||
# 设置时区和语言环境
|
# 设置时区和语言环境
|
||||||
@@ -49,7 +12,7 @@ RUN groupadd -r novalon && useradd -r -g novalon novalon
|
|||||||
WORKDIR /app
|
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参数优化
|
# 设置JVM参数优化
|
||||||
ENV JAVA_OPTS="-Xmx512m -Xms256m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom"
|
ENV JAVA_OPTS="-Xmx512m -Xms256m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom"
|
||||||
|
|||||||
@@ -1,41 +1,4 @@
|
|||||||
# 多阶段构建优化Dockerfile - 多模块项目(网关)
|
# 简化Dockerfile - 使用本地编译好的jar文件(网关)
|
||||||
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-gateway模块
|
|
||||||
RUN ./mvnw clean package -DskipTests -pl manage-gateway -am
|
|
||||||
|
|
||||||
# 运行时镜像
|
|
||||||
FROM eclipse-temurin:21-jre-jammy
|
FROM eclipse-temurin:21-jre-jammy
|
||||||
|
|
||||||
# 设置时区和语言环境
|
# 设置时区和语言环境
|
||||||
@@ -49,7 +12,7 @@ RUN groupadd -r novalon && useradd -r -g novalon novalon
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 复制构建产物
|
# 复制构建产物
|
||||||
COPY --from=builder --chown=novalon:novalon /app/manage-gateway/target/*.jar app.jar
|
COPY manage-gateway/target/manage-gateway-1.0.0.jar app.jar
|
||||||
|
|
||||||
# 设置JVM参数优化
|
# 设置JVM参数优化
|
||||||
ENV JAVA_OPTS="-Xmx512m -Xms256m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom"
|
ENV JAVA_OPTS="-Xmx512m -Xms256m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -Djava.security.egd=file:/dev/./urandom"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ FROM node:20-alpine AS builder
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 安装 pnpm
|
# 安装 pnpm
|
||||||
RUN npm install -g pnpm@8.15.0
|
RUN npm install -g pnpm@9
|
||||||
|
|
||||||
# 复制 package.json 和 lock 文件
|
# 复制 package.json 和 lock 文件
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ setup('authenticate', async ({ page }) => {
|
|||||||
await page.waitForLoadState('networkidle');
|
await page.waitForLoadState('networkidle');
|
||||||
|
|
||||||
await page.locator('input[placeholder*="用户名"]').fill('admin');
|
await page.locator('input[placeholder*="用户名"]').fill('admin');
|
||||||
await page.locator('input[placeholder*="密码"]').fill('admin123');
|
await page.locator('input[placeholder*="密码"]').fill('Test@123');
|
||||||
await page.locator('button:has-text("登录")').click();
|
await page.locator('button:has-text("登录")').click();
|
||||||
|
|
||||||
await page.waitForURL('**/dashboard', { timeout: 30000 });
|
await page.waitForURL('**/dashboard', { timeout: 30000 });
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const TARGET_URL = process.env.TARGET_URL || 'http://localhost:3002';
|
|||||||
const API_URL = process.env.API_URL || 'http://localhost:8080';
|
const API_URL = process.env.API_URL || 'http://localhost:8080';
|
||||||
const TEST_USER = {
|
const TEST_USER = {
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: 'admin123'
|
password: 'Test@123'
|
||||||
};
|
};
|
||||||
|
|
||||||
// 测试结果收集
|
// 测试结果收集
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default defineConfig({
|
|||||||
manualChunks: {
|
manualChunks: {
|
||||||
'vue-vendor': ['vue', 'vue-router', 'pinia'],
|
'vue-vendor': ['vue', 'vue-router', 'pinia'],
|
||||||
'element-plus': ['element-plus'],
|
'element-plus': ['element-plus'],
|
||||||
'utils': ['lodash-es', 'axios']
|
'utils': ['axios']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -47,7 +47,7 @@ export default defineConfig({
|
|||||||
reportCompressedSize: false
|
reportCompressedSize: false
|
||||||
},
|
},
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: ['vue', 'vue-router', 'pinia', 'element-plus', 'axios', 'lodash-es'],
|
include: ['vue', 'vue-router', 'pinia', 'element-plus', 'axios'],
|
||||||
exclude: []
|
exclude: []
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
|
|||||||
Reference in New Issue
Block a user