Previously the API (heimdall-central) and Blazor UI (heimdall-web) ran as separate containers with the Blazor Server making internal HTTP calls to the API. This caused the Blazor circuit to disconnect when the API was unreachable (network error → "Une erreur réseau est survenue"). Now both serve from the same .NET process on the same port: - All 16 API controllers, ExceptionFilter, and SignalR hubs integrated into Heimdall.Web - JWT auth, CORS, rate limiting configured in the unified Program.cs - Dockerfile.central entrypoint runs web/Heimdall.Web.dll - docker-compose simplified: heimdall-central service removed - CI publishes heimdall-web image instead of heimdall-central Also fixes timezone validation on Alpine/tzdata-less environments and enables FluentValidation auto-validation in the API project.
40 lines
1.3 KiB
Docker
40 lines
1.3 KiB
Docker
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.Api/*.csproj src/Heimdall.Api/
|
|
COPY src/Heimdall.Web/*.csproj src/Heimdall.Web/
|
|
COPY src/Heimdall.Workers/*.csproj src/Heimdall.Workers/
|
|
|
|
RUN dotnet restore src/Heimdall.Web/Heimdall.Web.csproj
|
|
RUN dotnet restore src/Heimdall.Workers/Heimdall.Workers.csproj
|
|
|
|
# Copy all source
|
|
COPY src/ src/
|
|
|
|
# Build and publish — the Web project now includes both Web UI and REST API
|
|
RUN dotnet publish src/Heimdall.Web/Heimdall.Web.csproj -c Release -o /app/web
|
|
RUN dotnet publish src/Heimdall.Workers/Heimdall.Workers.csproj -c Release -o /app/workers
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS runtime
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache icu-libs libstdc++ tzdata
|
|
|
|
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
|
|
ASPNETCORE_URLS=http://+:8080
|
|
|
|
COPY --from=build /app/web ./web
|
|
COPY --from=build /app/web/wwwroot ./wwwroot
|
|
COPY --from=build /app/workers ./workers
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["dotnet", "web/Heimdall.Web.dll"]
|