mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
26 lines
743 B
Docker
26 lines
743 B
Docker
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
|
WORKDIR /app
|
|
EXPOSE 7777
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
|
WORKDIR /src
|
|
# 将当前目录下的所有文件和文件夹复制到容器的当前工作目录中
|
|
COPY *.sln ./
|
|
COPY ["OpenAuth.WebApi/", "./OpenAuth.WebApi/"]
|
|
COPY ["Infrastructure/", "./Infrastructure/"]
|
|
COPY ["OpenAuth.App/", "./OpenAuth.App/"]
|
|
COPY ["OpenAuth.Repository/", "./OpenAuth.Repository/"]
|
|
RUN dotnet restore
|
|
|
|
# 发布
|
|
WORKDIR "/src/OpenAuth.WebApi"
|
|
|
|
FROM build AS publish
|
|
RUN dotnet publish -c Release -o /app/publish
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
# 将publish阶段生成的发布文件复制到当前工作目录 /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "OpenAuth.WebApi.dll"]
|