Move Dockerfile & NuGet.config to WebApi directory, update workflow

This commit is contained in:
masoud
2025-12-06 15:07:52 +00:00
parent 027b76c2e5
commit 44b87ecf50
4 changed files with 38 additions and 26 deletions

View File

@@ -0,0 +1,37 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy NuGet config
COPY NuGet.config ./
# Copy solution file
COPY ../FrontOffice.BFF.sln ./
# Copy all project files
COPY FrontOffice.BFF.WebApi.csproj ./FrontOffice.BFF.WebApi/
COPY ../FrontOffice.BFF.Application/*.csproj ./FrontOffice.BFF.Application/
COPY ../FrontOffice.BFF.Infrastructure/*.csproj ./FrontOffice.BFF.Infrastructure/
COPY ../FrontOffice.BFF.Domain/*.csproj ./FrontOffice.BFF.Domain/
COPY ../Protobufs/*/*.csproj ./Protobufs/
# Restore with NuGet.config
RUN dotnet restore "FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj" --configfile NuGet.config
# Copy all source code
COPY . ./FrontOffice.BFF.WebApi/
COPY ../FrontOffice.BFF.Application/ ./FrontOffice.BFF.Application/
COPY ../FrontOffice.BFF.Infrastructure/ ./FrontOffice.BFF.Infrastructure/
COPY ../FrontOffice.BFF.Domain/ ./FrontOffice.BFF.Domain/
COPY ../Protobufs/ ./Protobufs/
# Build and publish
RUN dotnet publish "FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj" -c Release -o /app/publish --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish .
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
ENTRYPOINT ["dotnet", "FrontOffice.BFF.WebApi.dll"]

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="FourSat" value="https://git.afrino.co/api/packages/FourSat/nuget/index.json" />
<add key="Afrino" value="https://git.afrino.co/api/packages/Afrino/nuget/index.json" />
</packageSources>
<packageSourceCredentials>
<FourSat>
<add key="Username" value="masoud" />
<add key="ClearTextPassword" value="87zH26nbqT" />
</FourSat>
<Afrino>
<add key="Username" value="systemuser" />
<add key="ClearTextPassword" value="sZSA7PTiv3pUSQZ" />
</Afrino>
</packageSourceCredentials>
</configuration>