diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..72acb0b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +bin/ +obj/ +Dockerfile +.dockerignore +*.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..736232d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +WORKDIR /src +COPY ["Fengling.AuthService.csproj", "./"] +RUN dotnet restore "Fengling.AuthService.csproj" +COPY . . +WORKDIR "/src" +RUN dotnet build "Fengling.AuthService.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Fengling.AuthService.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Fengling.AuthService.dll"]