Files
Heimdall/docker/Dockerfile.central
T
Arnaud Dartois 3f75a20860 fix(infra): copy web wwwroot to /app/wwwroot in Dockerfile
Static files are served from /app/wwwroot but the web publish
output is at /app/web/. Copying wwwroot to the expected location
so StaticFileMiddleware can find CSS, JS, and other static assets.
2026-07-19 19:14:47 +00:00

44 lines
1.5 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.Api/Heimdall.Api.csproj
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 API+Web combined container
RUN dotnet publish src/Heimdall.Api/Heimdall.Api.csproj -c Release -o /app/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++
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
ASPNETCORE_URLS=http://+:8080
COPY --from=build /app/api ./api
COPY --from=build /app/web ./web
COPY --from=build /app/web/wwwroot ./wwwroot
COPY --from=build /app/workers ./workers
# Expose both API and Web ports
EXPOSE 8080
ENTRYPOINT ["dotnet", "api/Heimdall.Api.dll"]