forked from mystatus/covid19-reports
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (26 loc) · 1006 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM node:14 as buildtime
ARG NPM_TOKEN
ENV NODE_PATH=/usr/local/lib/node_modules/:/usr/local/lib \
NPM_TOKEN="${NPM_TOKEN}"
WORKDIR /usr/src/covid19-reports
# Install dependencies (including private)
RUN echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > /usr/src/covid19-reports/.npmrc
COPY . /usr/src/covid19-reports
RUN yarn install \
&& find /usr/src/covid19-reports -name "*.sh" -exec chmod +x {} \; \
&& yarn build
FROM node:14 as runtime
ARG BUILD_DATE
LABEL maintainer="DDS - Devops <[email protected]>" \
description="This is the docker image for covid19-reports application" \
vendor="DDS" \
build-date="${BUILD_DATE}" \
build-number="${BUILD_NUMBER}"
ENV BUILD_DATE="${BUILD_DATE}" \
NODE_ENV=production \
NODE_OPTIONS="--max-old-space-size=4096"
WORKDIR /covid19-reports
COPY --from=buildtime /usr/src/covid19-reports /covid19-reports
RUN mkdir -p /covid19-reports/build/api/roster/uploads
EXPOSE 4000
CMD [ "yarn", "start" ]