-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile-production
44 lines (32 loc) · 1.01 KB
/
Dockerfile-production
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
39
40
41
42
43
44
#########################
### build environment ###
#########################
# base image - latest LTS
FROM node:dubnium as builder
# install chrome for protractor tests
# RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
# RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# RUN apt-get update && apt-get install -yq google-chrome-stable
# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# angular cli
RUN npm install -g @angular/[email protected] --unsafe
# install and cache app dependencies
COPY package.json package.json
RUN npm install --silent
# add app
COPY . .
# run tests
# RUN ng test --watch=false
# generate build
RUN npm run build
##################
### production ###
##################
FROM nginx:1.15.1-alpine
# copy artifact build from the 'build environment' above
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
# run nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]