-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (44 loc) · 1.29 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM node:16.14.0-alpine AS build_image
# couchbase sdk requirements
RUN apk update && \
apk add --no-cache make g++ vips vips-dev libc-dev && \
rm -rf /var/cache/apk/*
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
# install dependencies
RUN yarn install --frozen-lockfile
COPY . .
# lint & test
RUN yarn lint
# build application
RUN yarn build
FROM node:16.14.0-alpine
# Python
RUN apk update && \
apk add --no-cache vips vips-dev libc-dev && \
apk add --no-cache curl python3 python3-dev linux-headers build-base bash git && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
rm -r /root/.cache
# Timezone
RUN apk add --no-cache tzdata
ENV TZ=UTC
# Installs latest Chromium (77) package.
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
WORKDIR /usr/src/app
# copy from build image
COPY --from=build_image /usr/src/app ./
EXPOSE 3000
CMD ["yarn", "run", "start:prod"]