-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 714 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 714 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
#############################################################################
### Credit goes to : https://mherman.org/blog/dockerizing-an-angular-app/ ###
#############################################################################
# base image
FROM node:12.6.0 AS build
# set working directory
WORKDIR /app
# install app dependencies
RUN npm install -g yarn
COPY package.json /app/package.json
COPY yarn.lock /app/yarn.lock
RUN yarn
# add app
COPY . /app
# generate build
RUN yarn build:prod
# base image
FROM nginx:1.29-alpine
# copy artifact build from the 'build environment'
COPY --from=build /app/dist /usr/share/nginx/html
# expose port 80
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]