Skip to content

Commit 7dd93cf

Browse files
committed
Update Dockerfile to install node & npm run publish
1 parent e83ae5f commit 7dd93cf

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install and build npm
1515
run: |
1616
npm install
17-
npm run export
17+
npm run publish
1818
working-directory: ./ui
1919
- name: Setup dotnet
2020
uses: actions/setup-dotnet@v1

Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
2+
3+
RUN apt-get update -yq \
4+
&& apt-get -yq install curl gnupg ca-certificates \
5+
&& curl -L https://deb.nodesource.com/setup_lts.x | bash \
6+
&& apt-get update -yq \
7+
&& apt-get install -yq \
8+
nodejs
9+
210
WORKDIR /app
311

4-
COPY ./api .
12+
COPY ./ui ./ui
13+
COPY ./api ./api
14+
15+
WORKDIR /app/ui
16+
RUN npm install && npm run publish
17+
18+
WORKDIR /app/api
519
RUN dotnet restore
620

7-
WORKDIR /app/MyApp
21+
WORKDIR /app/api/MyApp
822
RUN dotnet publish -c release -o /out --no-restore
923

1024
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS runtime

ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"dev": "next",
55
"build": "next build",
66
"dtos": "cd lib && x ts",
7-
"export": "next build && next export -o ../api/MyApp/wwwroot",
7+
"publish": "next build && next export -o ../api/MyApp/wwwroot",
88
"start": "next start",
99
"typecheck": "tsc"
1010
},

0 commit comments

Comments
 (0)