FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app

COPY nuget.config /
COPY Complex.EndPoint/Complex.EndPoint.csproj Complex.EndPoint/
COPY Complex.Application/Complex.Application.csproj Complex.Application/
COPY Complex.Domain/Complex.Domain.csproj Complex.Domain/
COPY Complex.Infrastructure/Complex.Infrastructure.csproj Complex.Infrastructure/

RUN dotnet restore "Complex.EndPoint/Complex.EndPoint.csproj"

COPY . .

RUN dotnet publish "Complex.EndPoint/Complex.EndPoint.csproj" -c Release -o /app/publish

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
WORKDIR /app

COPY --from=build /app/publish .

EXPOSE 80
ENTRYPOINT ["dotnet", "Complex.EndPoint.dll"]
