Add dockerized host deploy flow and fix Blazor static boot assets

This commit is contained in:
Joseph Doherty
2026-02-06 17:44:46 -05:00
parent dd18a05408
commit 4e56ea3435
27 changed files with 777 additions and 1 deletions
+30
View File
@@ -0,0 +1,30 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN dotnet restore src/JdeScoping.Host/JdeScoping.Host.csproj
RUN dotnet publish src/JdeScoping.Host/JdeScoping.Host.csproj -c Release -o /app/publish --no-restore
RUN set -eux; \
fw="/app/publish/wwwroot/_framework"; \
wasm_js="$(find "$fw" -maxdepth 1 -type f -name 'blazor.webassembly.*.js' | head -n 1)"; \
[ -n "$wasm_js" ]; \
cp "$wasm_js" "$fw/blazor.webassembly.js"; \
dotnet_js="$(find "$fw" -maxdepth 1 -type f -name 'dotnet.*.js' ! -name 'dotnet.native.*.js' ! -name 'dotnet.runtime.*.js' | head -n 1)"; \
[ -n "$dotnet_js" ]; \
cp "$dotnet_js" "$fw/dotnet.js"; \
dotnet_native_js="$(find "$fw" -maxdepth 1 -type f -name 'dotnet.native.*.js' | head -n 1)"; \
[ -n "$dotnet_native_js" ]; \
cp "$dotnet_native_js" "$fw/dotnet.native.js"; \
dotnet_runtime_js="$(find "$fw" -maxdepth 1 -type f -name 'dotnet.runtime.*.js' | head -n 1)"; \
[ -n "$dotnet_runtime_js" ]; \
cp "$dotnet_runtime_js" "$fw/dotnet.runtime.js"
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish/ ./
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENTRYPOINT ["dotnet", "JdeScoping.Host.dll"]