admin/src/SimpleAdmin.Api/Dockerfile
zzh 1cef872823
All checks were successful
Build and Deploy / deploy (push) Successful in 1m1s
fix: 箱唛增加箱子总数,QuestPDF 注册中文字体防乱码
入库箱唛字段 boxCount;渲染时嵌入 CJK 字体,镜像安装 fonts-noto-cjk。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 12:44:49 +08:00

37 lines
1.5 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
ARG NUGET_IDESHIP=https://baget.ideship.com/v3/index.json
COPY ["NuGet.Config", "Directory.Build.props", "./"]
RUN sed -i \
-e "s|https://baget.ideship.com/v3/index.json|${NUGET_IDESHIP}|g" \
-e "s|http://baget.ideship.com/v3/index.json|${NUGET_IDESHIP}|g" \
-e "s|https://baget.xiaolipro.cn/v3/index.json|${NUGET_IDESHIP}|g" \
NuGet.Config \
&& cat NuGet.Config
COPY ["src/Oms.Domain/Oms.Domain.csproj", "src/Oms.Domain/"]
COPY ["src/Oms.SqlSugarCore/Oms.SqlSugarCore.csproj", "src/Oms.SqlSugarCore/"]
COPY ["src/Oms.Application/Oms.Application.csproj", "src/Oms.Application/"]
COPY ["src/SimpleAdmin.Api/SimpleAdmin.Api.csproj", "src/SimpleAdmin.Api/"]
RUN dotnet restore "src/SimpleAdmin.Api/SimpleAdmin.Api.csproj"
COPY . .
WORKDIR /src/src/SimpleAdmin.Api
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "SimpleAdmin.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
# 面单 QuestPDF 需 CJK 字体,否则中文 SKU 等渲染为 □
RUN apt-get update \
&& apt-get install -y --no-install-recommends fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /app/publish .
# Local 存储落盘 wwwroot;非 root 用户需可写 uploads(Provider=Cos 时可不依赖此目录)
RUN mkdir -p /app/wwwroot/uploads \
&& chown -R $APP_UID:$APP_UID /app/wwwroot
USER $APP_UID
ENTRYPOINT ["dotnet", "SimpleAdmin.Api.dll"]