From b63920625818e7582b22430f318203a08e06da94 Mon Sep 17 00:00:00 2001 From: movingsam Date: Thu, 26 Feb 2026 10:55:47 +0800 Subject: [PATCH] Add Dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e161079 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +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-console/Fengling.Console.csproj", "fengling-console/"] +COPY ["fengling-gateway/YarpGateway.csproj", "fengling-gateway/"] +COPY ["fengling-platform/Fengling.Platform.Infrastructure/Fengling.Platform.Infrastructure.csproj", "fengling-platform/Fengling.Platform.Infrastructure/"] +COPY ["fengling-platform/Fengling.Platform.Domain/Fengling.Platform.Domain.csproj", "fengling-platform/Fengling.Platform.Domain/"] +COPY ["fengling-service-discovery/Fengling.ServiceDiscovery.Core/Fengling.ServiceDiscovery.Core.csproj", "fengling-service-discovery/Fengling.ServiceDiscovery.Core/"] +COPY ["fengling-service-discovery/Fengling.ServiceDiscovery.Kubernetes/Fengling.ServiceDiscovery.Kubernetes.csproj", "fengling-service-discovery/Fengling.ServiceDiscovery.Kubernetes/"] +COPY ["fengling-service-discovery/Fengling.ServiceDiscovery.Static/Fengling.ServiceDiscovery.Static.csproj", "fengling-service-discovery/Fengling.ServiceDiscovery.Static/"] + +RUN dotnet restore "fengling-console/Fengling.Console.csproj" +COPY . . +WORKDIR "/src/fengling-console" +RUN dotnet build "./Fengling.Console.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +RUN dotnet publish "./Fengling.Console.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Fengling.Console.dll"] \ No newline at end of file