22 lines
1.2 KiB
Docker
22 lines
1.2 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/*
|
|
ENV ASPNETCORE_URLS=http://+: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://localhost:8080/healthz || exit 1
|
|
ENTRYPOINT ["dotnet", "Heimdall.Agent.dll"]
|