1.1K Star 4.8K Fork 1.7K

GVPdotNET China/OpenAuth.Net

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
李玉宝 提交于 2025-09-12 20:19 +08:00 . 🐛fix:修复正式环境没有关闭SWAGGER
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
# WebApi
EXPOSE 52789
# Identity
EXPOSE 12796
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# 将当前目录下的所有文件和文件夹复制到容器的当前工作目录中
COPY *.sln ./
COPY ["OpenAuth.WebApi/", "./OpenAuth.WebApi/"]
COPY ["OpenAuth.Identity/", "./OpenAuth.Identity/"]
COPY ["Infrastructure/", "./Infrastructure/"]
COPY ["OpenAuth.App/", "./OpenAuth.App/"]
COPY ["OpenAuth.Repository/", "./OpenAuth.Repository/"]
RUN dotnet restore OpenAuth.Net.sln
# 发布 WebApi
WORKDIR "/src/OpenAuth.WebApi"
RUN dotnet publish -c Release -o /app/publish/webapi
# 发布 Identity
WORKDIR "/src/OpenAuth.Identity"
RUN dotnet publish -c Release -o /app/publish/identity
FROM base AS final
WORKDIR /app
# 设置 Production 环境变量
ENV ASPNETCORE_ENVIRONMENT=Production
ENV DOTNET_ENVIRONMENT=Production
# 复制 WebApi 发布文件
COPY --from=build /app/publish/webapi ./webapi
# 复制 Identity 发布文件
COPY --from=build /app/publish/identity ./identity
# 启动 WebApi 和 Identity,就算失败也保持运行,方便查询日志
ENTRYPOINT ["sh", "-c", "cd webapi && dotnet OpenAuth.WebApi.dll & cd identity && dotnet OpenAuth.IdentityServer.dll || tail -f /dev/null"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/dotnetchina/OpenAuth.Net.git
git@gitee.com:dotnetchina/OpenAuth.Net.git
dotnetchina
OpenAuth.Net
OpenAuth.Net
main

搜索帮助