From e670a1d10c3bdee08c6c1ddbd1d240e8f8275576 Mon Sep 17 00:00:00 2001 From: movingsam Date: Thu, 26 Feb 2026 10:56:06 +0800 Subject: [PATCH] Add Dockerfile --- Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4b8511c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src + +COPY ["fengling-platform/Fengling.Platform.Domain/Fengling.Platform.Domain.csproj", "fengling-platform/Fengling.Platform.Domain/"] +COPY ["fengling-platform/Fengling.Platform.Infrastructure/Fengling.Platform.Infrastructure.csproj", "fengling-platform/Fengling.Platform.Infrastructure/"] + +RUN dotnet restore "fengling-platform/Fengling.Platform.Infrastructure/Fengling.Platform.Infrastructure.csproj" +COPY . . +WORKDIR "/src/fengling-platform/Fengling.Platform.Infrastructure" +RUN dotnet build "./Fengling.Platform.Infrastructure.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +RUN dotnet publish "./Fengling.Platform.Infrastructure.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Fengling.Platform.Infrastructure.dll"] \ No newline at end of file