# Runtime-only image for the ZB.MOM.WW.Overview dashboard.
#
# The app is published FRAMEWORK-DEPENDENT on the host (which holds the Gitea NuGet feed
# credentials in ~/.nuget) into ./publish, then copied in here. Docker performs NO restore and
# NO build, so the authenticated Gitea feed is never needed at image-build time. Regenerate
# ./publish with:
#   dotnet publish src/ZB.MOM.WW.Overview/ZB.MOM.WW.Overview.csproj \
#     -c Release -o docker/publish -p:UseAppHost=false
#
# The published IL is architecture-neutral, so the multi-arch aspnet:10.0 base runs as-is on
# both Apple Silicon and amd64 hosts.
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app

# The base image declares its own binding — as ASPNETCORE_HTTP_PORTS=8080 on .NET 8+, NOT the
# ASPNETCORE_URLS everyone reaches for first (clearing only URLS leaves the warning in place, which
# is a good way to spend an afternoon). Left set, it collides with the Kestrel endpoint section in
# appsettings.Docker.json: Kestrel wins, but logs "Overriding address(es) 'http://*:8080'" on every
# boot — the family's URLs-override trap arriving by default rather than by mistake. Clearing both
# at the layer that introduced them leaves the Kestrel section as the single authority.
ENV ASPNETCORE_URLS= \
    ASPNETCORE_HTTP_PORTS=

COPY publish/ ./

# Dashboard + /health/* + /metrics, all HTTP/1.1 and all anonymous.
EXPOSE 5320

ENTRYPOINT ["dotnet", "ZB.MOM.WW.Overview.dll"]
