# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY ["Drello.Server.csproj", "./"]
RUN dotnet restore
COPY . .
RUN dotnet publish -c Release -o /app/publish

# Run stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app/publish .
# This environment variable ensures it listens on port 80 inside the container
ENV ASPNETCORE_URLS=http://+:80
ENTRYPOINT ["dotnet", "Drello.Server.dll"]