mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-04 05:35:44 +00:00
code fixed
This commit is contained in:
30
Dockerfile
30
Dockerfile
@@ -1,42 +1,48 @@
|
|||||||
# ============= BUILD STAGE =============
|
# =============================
|
||||||
|
# BUILD STAGE
|
||||||
|
# =============================
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Copy project files first (better layer caching)
|
# Copy project files first for better caching
|
||||||
COPY Radzen.Blazor/*.csproj Radzen.Blazor/
|
COPY Radzen.Blazor/*.csproj Radzen.Blazor/
|
||||||
COPY Radzen.DocFX/*.csproj Radzen.DocFX/ # if any
|
|
||||||
COPY RadzenBlazorDemos/*.csproj RadzenBlazorDemos/
|
COPY RadzenBlazorDemos/*.csproj RadzenBlazorDemos/
|
||||||
COPY RadzenBlazorDemos.Host/*.csproj RadzenBlazorDemos.Host/
|
COPY RadzenBlazorDemos.Host/*.csproj RadzenBlazorDemos.Host/
|
||||||
|
|
||||||
# Restore using the host app as the entry point
|
# Radzen.DocFX usually has no csproj → copy full folder
|
||||||
|
COPY Radzen.DocFX/ Radzen.DocFX/
|
||||||
|
|
||||||
|
# Restore dependencies
|
||||||
RUN dotnet restore RadzenBlazorDemos.Host/RadzenBlazorDemos.Host.csproj
|
RUN dotnet restore RadzenBlazorDemos.Host/RadzenBlazorDemos.Host.csproj
|
||||||
|
|
||||||
# Now copy the rest of the source
|
# Copy full source after restore layer
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Install docfx in the *build* stage only
|
# Install docfx (build stage only)
|
||||||
RUN dotnet tool install -g docfx
|
RUN dotnet tool install -g docfx
|
||||||
ENV PATH="$PATH:/root/.dotnet/tools"
|
ENV PATH="$PATH:/root/.dotnet/tools"
|
||||||
|
|
||||||
# Build Radzen.Blazor if you need it as a separate step
|
# Build shared project (keep net8.0 if required)
|
||||||
# You can keep targeting net8.0 (or change to net10.0 if your TFM is net10.0)
|
|
||||||
RUN dotnet build -c Release Radzen.Blazor/Radzen.Blazor.csproj -f net8.0
|
RUN dotnet build -c Release Radzen.Blazor/Radzen.Blazor.csproj -f net8.0
|
||||||
|
|
||||||
# Generate docs (if needed in the image)
|
# Generate documentation
|
||||||
RUN docfx Radzen.DocFX/docfx.json
|
RUN docfx Radzen.DocFX/docfx.json
|
||||||
|
|
||||||
# Publish the host app
|
# Publish the Blazor host app
|
||||||
WORKDIR /src/RadzenBlazorDemos.Host
|
WORKDIR /src/RadzenBlazorDemos.Host
|
||||||
RUN dotnet publish -c Release -o /app/out
|
RUN dotnet publish -c Release -o /app/out
|
||||||
|
|
||||||
|
|
||||||
# ============= RUNTIME STAGE =============
|
# =============================
|
||||||
|
# RUNTIME STAGE
|
||||||
|
# =============================
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy published output from build stage
|
# Copy only published output
|
||||||
COPY --from=build /app/out ./
|
COPY --from=build /app/out ./
|
||||||
|
|
||||||
|
# Set runtime URL
|
||||||
ENV ASPNETCORE_URLS=http://+:5000
|
ENV ASPNETCORE_URLS=http://+:5000
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "RadzenBlazorDemos.Host.dll"]
|
ENTRYPOINT ["dotnet", "RadzenBlazorDemos.Host.dll"]
|
||||||
|
|||||||
Reference in New Issue
Block a user