-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (29 loc) · 1.45 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (29 loc) · 1.45 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
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Install python3 required by Emscripten WASM native toolchain
RUN apt-get update && apt-get install -y python3 && rm -rf /var/lib/apt/lists/*
# Copy solution and project files
COPY ["LocalLLMServerManager.slnx", "./"]
COPY ["LocalLLMServerManager.csproj", "./"]
COPY ["LocalLLMServerManager.Shared/LocalLLMServerManager.Shared.csproj", "LocalLLMServerManager.Shared/"]
COPY ["LocalLLMServerManager.Web/LocalLLMServerManager.Web.csproj", "LocalLLMServerManager.Web/"]
COPY ["LocalLLMServerManager.Tests/LocalLLMServerManager.Tests.csproj", "LocalLLMServerManager.Tests/"]
# Install WASM Workload
RUN dotnet workload install wasm-tools
# Restore dependencies
RUN dotnet restore "LocalLLMServerManager.slnx"
# Copy source code
COPY . .
# Build WASM UI and copy output to wwwroot
RUN dotnet publish "LocalLLMServerManager.Web/LocalLLMServerManager.Web.csproj" -c Release -r browser-wasm --nologo \
&& mkdir -p wwwroot/_framework \
&& cp -rf LocalLLMServerManager.Web/bin/Release/net10.0/browser-wasm/AppBundle/_framework/* wwwroot/_framework/
# Publish Main Server App
RUN dotnet publish "LocalLLMServerManager.csproj" -c Release -o /app/publish --nologo /p:PublishSingleFile=false
# Runtime Image
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
ENV ASPNETCORE_URLS=http://0.0.0.0:5246
EXPOSE 5246
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "LocalLLMServerManager.dll", "--service"]