# Stage 1: build and publish with the SDK image FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src COPY ClinicApi.csproj . RUN dotnet restore COPY . . RUN dotnet publish -c Release -o /app --no-restore # Stage 2: run on the much smaller ASP.NET Core runtime image FROM mcr.microsoft.com/dotnet/aspnet:10.0 WORKDIR /app COPY --from=build /app . ENV ASPNETCORE_URLS=http://+:8080 EXPOSE 8080 ENTRYPOINT ["dotnet", "ClinicApi.dll"]