Files
Heimdall/docker/Dockerfile
T
Arnaud Dartois 630e7987fe refactor(docker): merge worker and web into single heimdall image
Combine Heimdall.Web and Heimdall.Workers into one process/image.
Hangfire background jobs now run inside the web process.

- Move job classes to Infrastructure/Jobs/ (no Worker SDK dependency)
- Add Hangfire server + recurring jobs to Web/Program.cs
- Add missing AddInfrastructure/AddApplication DI registrations to Web
- Rename image: heimdall (was heimdall-web / heimdall-workers)
- Remove src/Heimdall.Workers project entirely
- Remove tests/Heimdall.Workers.Tests (placeholder)
- Simplify Dockerfile: single build target, no workers publish
- Update docker-compose files: one service heimdall, no workers
- Update Makefile, .env.example
2026-07-20 17:22:56 +00:00

45 lines
1.5 KiB
Docker

# ─── Heimdall — Single image (Web API + Blazor UI + Background Jobs) ──
# This image runs the combined Heimdall.Web process which serves:
# - Blazor UI (interactive Server)
# - REST API controllers
# - Hangfire background jobs (heartbeat monitor, agent failover)
# - SignalR hubs (config, events)
#
# Build: docker build -f docker/Dockerfile -t heimdall .
# Run: docker compose -f docker/docker-compose.yml up -d
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
WORKDIR /src
# Copy solution and project files
COPY *.slnx .
COPY Directory.Build.props .
COPY src/Heimdall.Domain.Primitives/*.csproj src/Heimdall.Domain.Primitives/
COPY src/Heimdall.Domain/*.csproj src/Heimdall.Domain/
COPY src/Heimdall.Application/*.csproj src/Heimdall.Application/
COPY src/Heimdall.Infrastructure/*.csproj src/Heimdall.Infrastructure/
COPY src/Heimdall.Web/*.csproj src/Heimdall.Web/
RUN dotnet restore src/Heimdall.Web/Heimdall.Web.csproj
# Copy all source
COPY src/ src/
# Build and publish — the Web project now includes Web UI, REST API, and background jobs
RUN dotnet publish src/Heimdall.Web/Heimdall.Web.csproj -c Release -o /app
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS runtime
WORKDIR /app
RUN apk add --no-cache icu-libs libstdc++ tzdata krb5
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
ASPNETCORE_URLS=http://+:8080
COPY --from=build /app .
COPY --from=build /app/wwwroot ./wwwroot
EXPOSE 8080
ENTRYPOINT ["dotnet", "Heimdall.Web.dll"]