-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 1.05 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (28 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copy solution file
COPY Redot-Documentation.sln .
# Copy ALL .csproj files
COPY Redot-Documentation/Redot-Documentation.csproj ./Redot-Documentation/
COPY Redot-Documentation.Client/Redot-Documentation.Client.csproj ./Redot-Documentation.Client/
COPY Redot-Documentation-Tests/Redot-Documentation-Tests.csproj ./Redot-Documentation-Tests/
# Restore ALL projects
RUN dotnet restore
# Copy everything else
COPY . .
# Publish the main project
WORKDIR /src/Redot-Documentation
RUN dotnet publish -c Release -o /app/publish -p:BlazorWebAssemblyEnableRuntime=true -p:BlazorWebAssemblyStaticWebAssets=true
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
EXPOSE 8080
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
VOLUME ["/app/App_Data/class-docs"]
# Copy published output
COPY --from=build /app/publish .
# Run the application
ENTRYPOINT ["dotnet", "Redot-Documentation.dll"]