fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 39s
Docker Build & Deploy / Deploy to Production (push) Successful in 10s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s

This commit is contained in:
2026-01-10 18:14:10 +08:00
parent 9aeb9c825e
commit 171febcfb6

View File

@@ -15,6 +15,10 @@ RUN pnpm run build
# 第二阶段:构建后端
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS backend-build
# 禁用遥测和减少并行度以尝试修复 exit code 134 (常见于内存受限环境下的崩溃)
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 \
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
WORKDIR /app
# 复制解决方案文件和项目文件
@@ -39,7 +43,8 @@ COPY Service/ ./Service/
COPY WebApi/ ./WebApi/
# 构建并发布
RUN dotnet publish WebApi/WebApi.csproj -c Release -o /app/publish
# 使用 -m:1 限制 CPU/内存并行度,减少容器构建崩溃风险
RUN dotnet publish WebApi/WebApi.csproj -c Release -o /app/publish --no-restore -m:1
# 将前端构建产物复制到后端的 wwwroot 目录
COPY --from=frontend-build /app/frontend/dist /app/publish/wwwroot