FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

COPY Guestlist.sln ./
COPY Guestlist/Guestlist.csproj Guestlist/
RUN dotnet restore Guestlist.sln

COPY Guestlist/ Guestlist/
RUN dotnet publish Guestlist/Guestlist.csproj \
    --configuration Release \
    --no-restore \
    --output /app/publish

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

ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080

COPY --from=build /app/publish ./

ENTRYPOINT ["dotnet", "Guestlist.dll"]
