Files
Anubis/deploy/docker/Dockerfile
T
Alby96andClaude Opus 5.5 99ff2d9402 Train the learning model at home and ship the first one with its validation
Logistic regression, boosted trees and random forest, calibration, purged
validation and the choice by mean gain per proposed operation (refs #63).
The first model comes from the crypto history: nothing better than the base
rate, so it starts in observation as the report says.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:34:41 +01:00

42 lines
2.3 KiB
Docker

# Anubis image (ADR 0003, SPEC 15.2). Build from the repository root:
# docker build -f deploy/docker/Dockerfile -t gitea.encke-hake.ts.net/balbosoft/anubis:dev .
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY global.json Directory.Build.props Directory.Packages.props ./
COPY src/Anubis/Anubis.csproj src/Anubis/packages.lock.json src/Anubis/
COPY src/Anubis.Server/Anubis.Server.csproj src/Anubis.Server/packages.lock.json src/Anubis.Server/
COPY src/Anubis.Guard/Anubis.Guard.csproj src/Anubis.Guard/packages.lock.json src/Anubis.Guard/
RUN dotnet restore src/Anubis.Server/Anubis.Server.csproj --locked-mode && \
dotnet restore src/Anubis.Guard/Anubis.Guard.csproj --locked-mode
COPY src/Anubis/ src/Anubis/
COPY src/Anubis.Server/ src/Anubis.Server/
COPY src/Anubis.Guard/ src/Anubis.Guard/
# The logo is embedded from docs/design/logo, its only source (ADR 0005).
COPY docs/design/logo/ docs/design/logo/
# The backtest outcomes are read at the first start (SPEC 12.3); .dockerignore lets only their JSON files through.
COPY docs/backtests/ docs/backtests/
COPY docs/learning/ docs/learning/
RUN dotnet publish src/Anubis.Server/Anubis.Server.csproj -c Release --no-restore -o /app
# The guard (SPEC 9.3, ADR 0012) is the main process and starts the engine next to it, from the same folder.
RUN dotnet publish src/Anubis.Guard/Anubis.Guard.csproj -c Release --no-restore -o /app
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app ./
COPY --chmod=755 deploy/docker/entrypoint.sh /usr/local/bin/anubis-entrypoint
# The port comes from PORT (8787 by default), read by the app; the base image's own port setting is cleared.
ENV ANUBIS_PLATFORM=docker \
ASPNETCORE_HTTP_PORTS= \
TZ=Europe/Rome \
PUID=99 \
PGID=100
EXPOSE 8787
VOLUME /data
# Starts as root only to give /data to PUID:PGID, then runs the guard as that user (entrypoint.sh); the guard starts
# the engine. "docker run --rm <image> drill" runs the guard drill instead (issue #48).
# Health through bash's /dev/tcp: no curl or wget in the image. 503 (database down) counts as unhealthy.
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
CMD ["bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/${PORT:-8787} && printf 'GET /health HTTP/1.0\r\nHost: localhost\r\n\r\n' >&3 && head -n 1 <&3 | grep -q ' 200 '"]
ENTRYPOINT ["anubis-entrypoint"]