-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
82 lines (66 loc) · 2.93 KB
/
Dockerfile
File metadata and controls
82 lines (66 loc) · 2.93 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Samples
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
RUN apt update \
&& apt install -y --no-install-recommends python3 python3-pip libatomic1 \
&& rm -rf /var/lib/apt/lists/*
RUN dotnet workload install wasm-tools aspire
RUN dotnet dev-certs https
WORKDIR /samples
COPY ["src/", "src/"]
COPY ["docs/", "docs/"]
COPY ["*.props", "."]
COPY Samples.sln .
RUN dotnet build -c:Debug
RUN dotnet build -c:Release --no-restore
# Create HelloWorld sample image
FROM build AS sample_hello_world
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/HelloWorld/debug/Samples.HelloWorld.dll"]
# Create HelloCart sample image
FROM build AS sample_hello_cart
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/HelloCart/debug/Samples.HelloCart.dll"]
# Create HelloBlazorServer sample image
FROM build AS sample_hello_blazor_server
WORKDIR /samples/src/HelloBlazorServer
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/HelloBlazorServer/debug/Samples.HelloBlazorServer.dll"]
# Create HelloBlazorHybrid sample image
FROM build AS sample_hello_blazor_hybrid
WORKDIR /samples/src/HelloBlazorHybrid/Server
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/HelloBlazorHybrid.Server/debug/Samples.HelloBlazorHybrid.Server.dll"]
# Create Blazor sample image
FROM build AS sample_blazor
WORKDIR /samples/src/Blazor/Server
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/Blazor.Server/debug/Samples.Blazor.Server.dll"]
# Create TodoApp sample image
FROM build AS sample_todoapp
WORKDIR /samples/src/TodoApp/Host
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/TodoApp.Host/debug/Samples.TodoApp.Host.dll"]
# Create MiniRpc sample image
FROM build AS sample_mini_rpc
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/MiniRpc/release/Samples.MiniRpc.dll"]
# Create MultiServerRpc sample image
FROM build AS sample_multi_server_rpc
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/MultiServerRpc/release/Samples.MultiServerRpc.dll"]
# Create MeshRpc sample image
FROM build AS sample_mesh_rpc
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/MeshRpc/release/Samples.MeshRpc.dll"]
# Create Benchmark sample image
FROM build AS sample_benchmark
ENV DbHost=host.docker.internal
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/Benchmark/release/Samples.Benchmark.dll"]
# Create RpcBenchmark sample image
FROM build AS sample_rpc_benchmark
ENTRYPOINT ["dotnet", "/samples/artifacts/bin/RpcBenchmark/release/Samples.RpcBenchmark.dll"]
# Websites
FROM build AS publish
WORKDIR /samples
RUN dotnet publish -c:Release --no-build --no-restore src/Blazor/Server/Server.csproj
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
WORKDIR /app
COPY --from=publish /samples/artifacts/publish/Blazor.Server/release .
# Create Blazor sample image for website
FROM runtime AS sample_blazor_ws
ENV Logging__Console__FormatterName=
ENV Server__GitHubClientId=7d519556dd8207a36355
ENV Server__GitHubClientSecret=8e161ca4799b7e76e1c25429728db6b2430f2057
ENTRYPOINT ["dotnet", "/app/Samples.Blazor.Server.dll"]