diff --git a/Dockerfile b/Dockerfile index e277c65..b16440a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN go mod download COPY . . # 从前端构建阶段复制构建好的静态文件 -COPY --from=frontend-builder /app/dist ./web/dist +COPY --from=frontend-builder /app/frontend/dist ./web/dist # 设置 musl 兼容参数(解决 pread64/pwrite64/off64_t 问题) ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE=1 -D_GNU_SOURCE=1 -Doff64_t=off_t -Dpread64=pread -Dpwrite64=pwrite" @@ -65,6 +65,9 @@ RUN addgroup -g 1001 -S mailcat && \ # 复制构建好的应用 COPY --from=go-builder /app/mailcat . +# 复制前端静态文件 +COPY --from=go-builder /app/web/dist ./web/dist + # 复制配置文件模板 COPY --from=go-builder /app/config ./config diff --git a/config/config.yaml b/config/config.yaml index b9326be..d153ad3 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -6,7 +6,7 @@ database: path: "./data/emails.db" api: - auth_token: "" + auth_token: "your_auth_token" admin: - password: "" \ No newline at end of file + password: "your_admin_password" \ No newline at end of file diff --git a/web/frontend/vite.config.js b/web/frontend/vite.config.js index 8655ae2..34dea87 100644 --- a/web/frontend/vite.config.js +++ b/web/frontend/vite.config.js @@ -5,7 +5,7 @@ export default defineConfig({ plugins: [vue()], base: '/admin/', build: { - outDir: '../dist', + outDir: 'dist', emptyOutDir: true, rollupOptions: { output: {