-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
39 lines (30 loc) · 1.01 KB
/
Dockerfile
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
FROM node as build-front-env
# copy all content from repository
COPY . .
# build svelte front
WORKDIR /dendrOnlineSPA
RUN ls -alh
RUN pwd
RUN npm install
RUN npm run build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-back-env
WORKDIR ./
# Copy csproj and restore as distinct layers ....
COPY TreeMe.sln .
COPY BackEnd/BackEnd.csproj ./BackEnd/BackEnd.csproj
COPY GitHubOAuthMiddleWare/GitHubOAuthMiddleWare.csproj ./GitHubOAuthMiddleWare/GitHubOAuthMiddleWare.csproj
COPY dendrOnlineSPA/dendrOnlineSPA.csproj ./dendrOnlineSPA/dendrOnlineSPA.csproj
COPY Tests/Tests.csproj ./Tests/Tests.csproj
RUN dotnet restore
# Copy everything else and build
COPY . .
# Copy svelte javascript/CSS assets
COPY --from=build-front-env /dendrOnlineSPA/wwwroot /dendrOnlineSPA/wwwroot
# build aspnet core application
RUN dotnet publish --no-restore -c Release -o out ./dendrOnlineSPA
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /
# copy application
COPY --from=build-back-env /out .
ENTRYPOINT ["./dendrOnlineSPA"]