build-flow.api/Dockerfile
xiangning c813230b8d perf(docker): base 镜像走 Harbor Proxy Cache
dotnet sdk/aspnet FROM 改走 mcr-proxy(43.134.235.58:58080/mcr-proxy/dotnet/...),
经 Harbor 回源 mcr.microsoft.com 并本地缓存,避免公网拉取 connection reset。
devops 宿主 daemon 已配该 Harbor 为 insecure-registries。
2026-07-17 12:13:01 +08:00

23 lines
785 B
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.

# BuildFlow API (.NET 10) 多阶段构建
# base 镜像走 Harbor Proxy Cache(mcr-proxy → mcr.microsoft.com),避免公网拉取超时
FROM 43.134.235.58:58080/mcr-proxy/dotnet/sdk:10.0 AS build
WORKDIR /src
# 先拷贝 sln 和 props,利用层缓存恢复 NuGet
COPY BuildFlow.slnx Directory.Build.props ./
COPY src/ ./src/
# 还原 + 发布 Host (含全部模块)
RUN dotnet publish src/BuildFlow.Host/BuildFlow.Host.csproj -c Release -o /app/publish /p:UseAppHost=false
# 运行时镜像
FROM 43.134.235.58:58080/mcr-proxy/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app/publish ./
# 容器内监听 5667 (与 appsettings 一致), 但绑定 0.0.0.0 以便外部访问
ENV ASPNETCORE_URLS=http://0.0.0.0:5667
EXPOSE 5667
ENTRYPOINT ["dotnet", "BuildFlow.Host.dll"]