2026-07-16 20:53:56 +00:00
|
|
|
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
|
2026-07-18 20:44:38 +00:00
|
|
|
RUN dotnet restore src/Heimdall.Web/Heimdall.Web.csproj
|
2026-07-16 20:53:56 +00:00
|
|
|
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
|
2026-07-19 19:14:47 +00:00
|
|
|
COPY --from=build /app/web/wwwroot ./wwwroot
|
2026-07-16 20:53:56 +00:00
|
|
|
COPY --from=build /app/workers ./workers
|
|
|
|
|
|
|
|
|
|
# Expose both API and Web ports
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["dotnet", "api/Heimdall.Api.dll"]
|