-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
36 lines (27 loc) · 982 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
FROM node:16-alpine as develop
WORKDIR /usr/src/app
RUN apk add g++ make py3-pip
# install node-canvas dependencies
RUN apk add build-base cairo-dev jpeg-dev pango pango-dev giflib-dev imagemagick freetype fontconfig
COPY package*.json ./
RUN npm ci
COPY . .
CMD [ "npx", "ts-node", "-r", "tsconfig-paths/register", "src/server.ts" ]
FROM node:16-alpine as build
WORKDIR /usr/src/app
COPY --from=develop ./usr/src/app/ ./
RUN npm run build
COPY newrelic.js dist/newrelic.js
FROM node:16-alpine as production
ENV NODE_ENV=production
WORKDIR /usr/src/app
COPY package* ./
RUN npm config set update-notifier false
RUN apk add --virtual .build g++ make py3-pip && \
# install node-canvas dependencies
apk add build-base cairo-dev jpeg-dev pango pango-dev giflib-dev imagemagick freetype fontconfig && \
npm ci --production && \
apk del .build
COPY --from=build ./usr/src/app/dist ./
COPY tsconfig.json ./
CMD [ "-r", "tsconfig-paths/register", "src/server.js" ]