-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.prod
48 lines (33 loc) · 872 Bytes
/
Dockerfile.prod
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
FROM node:14.17-alpine
WORKDIR /usr/src/app
# add libraries; sudo so non-root user added downstream can get sudo
RUN apk add --no-cache \
sudo \
curl \
build-base \
g++ \
libpng \
libpng-dev \
jpeg-dev \
pango-dev \
cairo-dev \
giflib-dev \
python \
;
# add glibc and install canvas
RUN apk --no-cache add ca-certificates wget && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk && \
apk add glibc-2.29-r0.apk
COPY ./package*.json ./
RUN npm ci
ENV NODE_ENV=production
COPY ./tsconfig.json ./
COPY ./assets ./assets
COPY ./src ./src
COPY ./.env.template.json ./.env.json
COPY ./build.sh ./
RUN npm run prod:build
RUN rm ./.env.json
WORKDIR /usr/src/app/dist
CMD npm run prod:start