-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (29 loc) · 995 Bytes
/
Dockerfile
File metadata and controls
34 lines (29 loc) · 995 Bytes
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
FROM node:22-trixie as nodebuilder
WORKDIR /js
COPY fluidsignalr/ClientApp/package.json /js/
# no package-lock.json checked in, go to hell
RUN npm install
COPY fluidsignalr/ClientApp/src /js/src
COPY fluidsignalr/ClientApp/.parcelrc /js/
RUN npm run build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY *.sln .
COPY fluidsignalr/*.csproj ./fluidsignalr/
RUN dotnet restore
# copy source files and build app
COPY fluidsignalr/*.cs ./fluidsignalr/
COPY fluidsignalr/*.json ./fluidsignalr/
WORKDIR /app/fluidsignalr
# Copy the js dist from the nodebuilder stage; the csproj has a target to copy it over to the out dir
COPY --from=nodebuilder /js/dist /app/fluidsignalr/ClientApp/dist
RUN dotnet publish -c Release -o out
###
### Final runtime image
###
FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble-chiseled AS runtime
WORKDIR /app
COPY --from=build /app/fluidsignalr/out ./
EXPOSE 8080
ENTRYPOINT ["dotnet", "fluidsignalr.dll"]