-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (29 loc) · 756 Bytes
/
Dockerfile
File metadata and controls
32 lines (29 loc) · 756 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
# ---- Base Node ----
FROM node:12-stretch AS base
# set working directory
WORKDIR /usr/src/pacifica-metadata-mgmt
# Set running user PATH
ENV PATH /usr/src/pacifica-metadata-mgmt/node_modules/.bin:$PATH
# copy project file
COPY package.json .
COPY package-lock.json .
#
# ---- Dependencies ----
FROM base AS dependencies
# install node packages
RUN npm set progress=false && npm config set depth 0
RUN npm install --silent
COPY . .
# Create Production build
RUN npm run build
#
# ---- Test ----
# run linters, setup and tests (if appropriate)
FROM dependencies AS test
RUN npm run eslint
#
# ---- Release ----
FROM nginx
COPY --from=dependencies /usr/src/pacifica-metadata-mgmt/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]