﻿# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview AS build
WORKDIR /src

# Copy solution and project files
COPY ["Nashel.sln", "./"]
COPY ["src/", "src/"]

# Restore dependencies
RUN dotnet restore "Nashel.sln"

# Copy the rest of the source code (already copied in previous step fundamentally, but ensuring context)
# Actually, copying src/ covers it.

# Publish the application
WORKDIR "/src/src/Host"
RUN dotnet publish "Nashel.Host.csproj" -c Release -o /app/publish /p:UseAppHost=false

# Final stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0-preview AS final
WORKDIR /app
COPY --from=build /app/publish .
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
ENTRYPOINT ["dotnet", "Nashel.Host.dll"]
