-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
37 lines (32 loc) · 1.04 KB
/
Dockerfile
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
# ---- Base Node ----
FROM node:14.11.0-alpine AS base
RUN apk add --no-cache nodejs-current tini
WORKDIR /www
# Set tini as entrypoint
ENTRYPOINT ["/sbin/tini", "--"]
# copy project file
COPY package.json .
# ---- Dependencies ----
FROM base AS dependencies
# install git to pull down ews-api-lib
RUN apk update && apk upgrade && apk add --no-cache git
# install node packages
RUN npm set progress=false && npm config set depth 0
RUN npm install --only=production
# copy production node_modules aside
RUN cp -R node_modules prod_node_modules
# install ALL node_modules, including 'devDependencies'
RUN npm install
COPY . .
# build the project
RUN npm run build
# ---- Release ----
FROM base AS release
# copy production node_modules
COPY --from=dependencies /www/prod_node_modules /www/node_modules
# copy only the things we need for production
COPY --from=dependencies /www/dist /www/dist
# sp-key.pem is injected by Azure DevOps, copy it to a better location
COPY sp-key.pem /www/config/sp-key.pem
EXPOSE 1111
CMD npm start