fengling-gateway/Dockerfile
movingsam 564d664426
Some checks failed
Build and Deploy / build (push) Successful in 22s
Build and Deploy / docker (push) Successful in 26m23s
Build and Deploy / deploy (push) Failing after 3s
refactor: move project to src/ and add slnx
- Add YarpGateway.slnx solution file
- Move all project files to src/ directory
- Update Dockerfile for new src/ path structure
- Update CI/CD workflow with src/ project path
- Fix NuGet package references (use Gitea NuGet packages)
- Add CPM (Central Package Management) with Directory.Packages.props
2026-02-28 13:10:41 +08:00

33 lines
811 B
Docker

FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
# Copy project files from src
COPY ["src/Directory.Packages.props", "src/"]
COPY ["src/YarpGateway.csproj", "src/"]
COPY ["src/NuGet.Config", "src/"]
# Restore dependencies
RUN dotnet restore "src/YarpGateway.csproj"
# Copy all source code
COPY . .
WORKDIR "/src"
RUN dotnet build "src/YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "src/YarpGateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "YarpGateway.dll"]