FROM mcr.microsoft.com/dotnet/sdk:8.0 as build
WORKDIR /app
EXPOSE 80
COPY TotechsThunder.sln TotechsThunder.sln
COPY src/LightningLanes/API/LightningLanes.csproj src/LightningLanes/API/LightningLanes.csproj
COPY src/LightningLanes/Core/LightningLanes.Core/LightningLanes.Core.csproj src/LightningLanes/Core/LightningLanes.Core/LightningLanes.Core.csproj
COPY src/LightningLanes/Jobs/LightningLanes.HangfireJobHost/LightningLanes.HangfireJobHost.csproj src/LightningLanes/Jobs/LightningLanes.HangfireJobHost/LightningLanes.HangfireJobHost.csproj
COPY src/Features/GitHubFeatures/Logics/Logics.csproj src/Features/GitHubFeatures/Logics/Logics.csproj
COPY src/Features/GitHubFeatures/Tests/Tests.csproj src/Features/GitHubFeatures/Tests/Tests.csproj
COPY src/Technologies/Technologies.csproj src/Technologies/Technologies.csproj
COPY src/Projects/Projects.csproj src/Projects/Projects.csproj
COPY src/Contracts/Contracts.csproj src/Contracts/Contracts.csproj
COPY src/IdentityServer/IdentityServer.csproj src/IdentityServer/IdentityServer.csproj
COPY src/Gateway/Gateway.csproj src/Gateway/Gateway.csproj
RUN dotnet restore TotechsThunder.sln
COPY src/LightningLanes/API src/LightningLanes/API
COPY src/LightningLanes/Core/LightningLanes.Core src/LightningLanes/Core/LightningLanes.Core
COPY src/Contracts src/Contracts
WORKDIR /app/src/LightningLanes/API
RUN dotnet publish -c Release -o /app/src/out
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app/src/out .
ENTRYPOINT [ "dotnet", "LightningLanes.dll" ]