Skip to content

Commit a2460e9

Browse files
author
Ankur Srivastava
committed
build the distribution inside docker container, thus removing dependencies on external npm, nvm
1 parent c12d275 commit a2460e9

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

front/Dockerfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# build stage
2+
FROM mhart/alpine-node:8 AS build-env
3+
4+
COPY . /frontend
5+
6+
WORKDIR /frontend
7+
8+
RUN npm install webpack-dev-server rimraf webpack typescript -g \
9+
&& npm install \
10+
&& npm run build:prod
11+
12+
# final stage
113
FROM nginx:alpine
2-
COPY nginx.conf /etc/nginx/
3-
COPY dist /usr/share/nginx/html
14+
15+
WORKDIR /app
16+
17+
COPY --from=build-env /frontend/dist /usr/share/nginx/html
18+
19+
COPY --from=build-env /frontend/nginx.conf /etc/nginx/

0 commit comments

Comments
 (0)