31 lines
1.2 KiB
Docker
31 lines
1.2 KiB
Docker
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"]
|