# Build the service, then run it on the smaller ASP.NET runtime image.
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

COPY Directory.Build.props ./
COPY AvParser.ImgTestService.csproj ./
RUN dotnet restore AvParser.ImgTestService.csproj

COPY . ./
RUN dotnet publish AvParser.ImgTestService.csproj -c Release -o /app --no-restore

FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
COPY --from=build /app ./

# Listen on 8080 inside the container; a reverse proxy terminates TLS for the public domain.
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080

ENTRYPOINT ["dotnet", "AvParser.ImgTestService.dll"]
