-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (26 loc) · 913 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
FROM node:15.8.0-alpine as build-base
WORKDIR /build
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package due to Puppeteer compatibility with Docker.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
COPY package.json package-lock.json ./
FROM build-base as prod-deps-image
RUN npm install --production
FROM prod-deps-image as build-image
RUN npm install
COPY . ./
RUN npm run build
FROM node:15.8.0-alpine as runtime
WORKDIR /app
COPY --from=prod-deps-image /build/node_modules/ ./node_modules
COPY --from=build-image /build/dist/ ./dist
# https://github.com/puppeteer/puppeteer/blob/v7.1.0/docs/troubleshooting.md#running-on-alpine
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
CMD [ "node", "/app/dist/index.js" ]