Files
Heimdall/docker/Dockerfile.agent
T
Arnaud Dartois 8ebcdb81a6
Heimdall Gitea / Build and tests (pull_request) Failing after 2m24s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
fix(agent): secure diagnostics and require TLS to central
2026-10-22 06:56:06 +02:00

24 lines
1.3 KiB
Docker

# CPU agent: use glibc for ONNX native dependencies. GPU variants need a
# separately validated .NET/native-library runtime and are not published here.
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble@sha256:0d99ebf1ccad15037b5c98c9fe8979d6b8dbac23812feae2277a0b277b5c5ffa AS build
WORKDIR /src
ARG VERSION=0.0.0-local
ARG TARGET_RUNTIME=cpu
RUN test "$TARGET_RUNTIME" = cpu
COPY global.json Directory.Build.props Directory.Build.targets ./
COPY src/ ./src/
RUN dotnet restore src/Heimdall.Agent/Heimdall.Agent.csproj --locked-mode
RUN dotnet publish src/Heimdall.Agent/Heimdall.Agent.csproj -c Release --no-restore -o /out -p:Version=$VERSION -p:ContinuousIntegrationBuild=true
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble@sha256:d5633778c754e89a386882eddf8dbee6942447a8a4b8267c19cf1e1158d0b0ac
WORKDIR /app
RUN apt-get update -qq && apt-get install -y --no-install-recommends ffmpeg wget libgomp1 tzdata && rm -rf /var/lib/apt/lists/*
# The agent only needs these diagnostic endpoints for its local healthcheck.
# Keep them off the host/container network interfaces by default.
ENV ASPNETCORE_URLS=http://127.0.0.1:8080
COPY --from=build /out/ ./
COPY models/yolov8n.onnx ./models/yolov8n.onnx
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s CMD wget -q --spider http://127.0.0.1:8080/healthz || exit 1
ENTRYPOINT ["dotnet", "Heimdall.Agent.dll"]