-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (35 loc) · 1001 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
42
43
FROM node:14-alpine as build-stage
WORKDIR /app
# install build dependencies
RUN apk add \
--no-cache \
bash \
build-base \
fftw-dev \
git \
make \
python3
# install application dependencies
COPY package.json yarn.lock ./
RUN JOBS=max yarn install --non-interactive --frozen-lockfile
# copy in application source
COPY . .
# run tests and build typescript sources
RUN make lib ci-test
# prune modules
RUN yarn install --non-interactive --frozen-lockfile --production
# copy built application to runtime image
FROM node:14-alpine
WORKDIR /app
RUN apk add \
--no-cache \
--repository https://alpine.global.ssl.fastly.net/alpine/v3.10/community \
fftw
COPY --from=build-stage /app/config config
COPY --from=build-stage /app/lib lib
COPY --from=build-stage /app/node_modules node_modules
COPY --from=build-stage /app/cleanup.js cleanup.js
# run in production mode
ENV NODE_ENV production
ENV NODE_CONFIG_ENV production,blacklist
CMD [ "node", "lib/app.js" ]