-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
23 lines (17 loc) · 925 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# BASE IMAGE with an alias #
FROM node:14.17.3-alpine3.11 as build
WORKDIR /app
RUN npm install -g @angular/cli
# copying the package.json file alone from our angular project and copy it onto the container directory
COPY ./package.json .
# nstalls all the necessary dependencies for our angular project onto the container
RUN npm install
# copy all the contents in our angular project onto the container.
# This includes the src, e2c, tsconfig and other files which are in the angular project directory
COPY . .
# packs the angular application into index.html and minified JavaScript files.
RUN ng build
FROM nginx as runtime
# We now have our angular application built and the binaries available under /app/dist/ngzoro in the container
# so copy angular files into the path "/usr/share/nginx/html-> which is docker servers default index file is found here"
COPY --from=build /app/dist/ngzoro /usr/share/nginx/html