- Remove .planning/ directory (GSD workflow artifacts) - Remove 网关配置的新想法.md (outdated design doc) - Keep only essential technical documentation
40 lines
1.2 KiB
Docker
40 lines
1.2 KiB
Docker
FROM 192.168.100.120:8418/fengling/dotnet/aspnet:10.0 AS base
|
|
USER root
|
|
RUN apk add --no-cache krb5-libs
|
|
USER $APP_UID
|
|
WORKDIR /app
|
|
EXPOSE 8080
|
|
EXPOSE 8081
|
|
|
|
FROM 192.168.100.120:8418/fengling/dotnet/sdk:10.0 AS build
|
|
ARG BUILD_CONFIGURATION=Release
|
|
WORKDIR /src
|
|
|
|
# Copy NuGet config first
|
|
COPY ["NuGet.Config", "./"]
|
|
|
|
# Copy all project files for restore
|
|
COPY ["src/yarpgateway/*.props", "src/yarpgateway/"]
|
|
COPY ["src/yarpgateway/*.csproj", "src/yarpgateway/"]
|
|
COPY ["src/Fengling.Gateway.Plugin.Abstractions/*.csproj", "src/Fengling.Gateway.Plugin.Abstractions/"]
|
|
|
|
# Copy all source code
|
|
COPY . .
|
|
|
|
# Restore dependencies (after copying all code to ensure project references work)
|
|
RUN dotnet restore "src/yarpgateway/YarpGateway.csproj" --configfile "NuGet.Config"
|
|
|
|
# Build
|
|
WORKDIR "/src/src/yarpgateway"
|
|
RUN dotnet build "YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/build --no-restore
|
|
|
|
FROM build AS publish
|
|
ARG BUILD_CONFIGURATION=Release
|
|
WORKDIR "/src/src/yarpgateway"
|
|
RUN dotnet publish "YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false --no-restore
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "YarpGateway.dll"]
|