Files
Rendezvous/Dockerfile
KyuubiYoru dc2de76963 feat(server): answer the root path and probe container health
A bare GET / previously returned an empty 404, which reads as an outage
even while the service is healthy. The root now redirects to
/diagnostics when the dashboard is enabled and otherwise returns a
small JSON status pointing at /health/live. The route is excluded from
the OpenAPI description, so the frozen v1 surface is unchanged.

The chiseled runtime image ships no shell or curl, so the container
healthcheck re-enters the server assembly with --health-probe, which
queries the local liveness endpoint and reports through the exit code.
Dockerfile and compose both wire the probe (30s interval, 3 retries).
2026-08-31 03:55:17 +02:00

40 lines
2.1 KiB
Docker

# syntax=docker/dockerfile:1.7@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e
FROM mcr.microsoft.com/dotnet/sdk:10.0.301-noble@sha256:ea8bde36c11b6e7eec2656d0e59101d4462f6bd630730f2c8201ed0572b295d5 AS build
ARG SOURCE_REVISION_ID
WORKDIR /source
COPY Directory.Build.props Directory.Packages.props NuGet.config global.json Rendezvous.slnx ./
COPY eng/Versions.props eng/Versions.props
COPY src/FinalFactory.Rendezvous.Contracts/FinalFactory.Rendezvous.Contracts.csproj src/FinalFactory.Rendezvous.Contracts/packages.lock.json src/FinalFactory.Rendezvous.Contracts/
COPY src/FinalFactory.Rendezvous.Server/FinalFactory.Rendezvous.Server.csproj src/FinalFactory.Rendezvous.Server/packages.lock.json src/FinalFactory.Rendezvous.Server/
RUN dotnet restore src/FinalFactory.Rendezvous.Server/FinalFactory.Rendezvous.Server.csproj --locked-mode
COPY src/FinalFactory.Rendezvous.Contracts/ src/FinalFactory.Rendezvous.Contracts/
COPY src/FinalFactory.Rendezvous.Server/ src/FinalFactory.Rendezvous.Server/
RUN dotnet publish src/FinalFactory.Rendezvous.Server/FinalFactory.Rendezvous.Server.csproj \
--configuration Release \
--no-restore \
--output /out \
/p:UseAppHost=false \
/p:OpenApiGenerateDocuments=false \
/p:ContinuousIntegrationBuild=true \
/p:RepositoryCommit="$SOURCE_REVISION_ID" \
/p:SourceRevisionId="$SOURCE_REVISION_ID"
FROM mcr.microsoft.com/dotnet/aspnet:10.0.11-noble-chiseled@sha256:0839314d08bb65da369135389a5d8291f75ace587fbb0488f469eb92c62eef68 AS runtime
ENV ASPNETCORE_HTTP_PORTS=8080 \
DOTNET_EnableDiagnostics=0 \
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
TMPDIR=/tmp
WORKDIR /app
COPY --from=build --chown=1654:1654 /out/ ./
USER 1654:1654
EXPOSE 8080/tcp
EXPOSE 9050/udp
# The chiseled image has no shell or curl; the probe re-enters the server
# assembly in --health-probe mode and reports through the exit code.
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD ["dotnet", "FinalFactory.Rendezvous.Server.dll", "--health-probe"]
ENTRYPOINT ["dotnet", "FinalFactory.Rendezvous.Server.dll"]