-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (25 loc) · 895 Bytes
/
Dockerfile
File metadata and controls
26 lines (25 loc) · 895 Bytes
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
FROM node:20-alpine AS builder
WORKDIR /build
RUN apk add --update --no-cache \
# Gyp build dependencies
python3 make g++ py-setuptools \
# Canvas build dependencies
pixman-dev cairo-dev jpeg-dev pango-dev giflib-dev pixman-dev pangomm-dev libjpeg-turbo-dev freetype-dev pkgconfig; \
rm -rf /var/cache/apk/*
COPY . .
RUN npm install && \
npm run build:prod && \
npm prune --production && \
mv dist /app && \
mv node_modules /app/node_modules
FROM node:20-alpine AS runtime
WORKDIR /app
RUN apk add --update --no-cache \
# Canvas runtime dependencies
python3 cairo jpeg pango giflib pixman pangomm libjpeg-turbo freetype; \
rm -rf /var/cache/apk/*
ENV PORT=80
EXPOSE 80
HEALTHCHECK --interval=10s --timeout=5s --retries=2 CMD wget --no-verbose --tries=1 --spider "http://127.0.0.1:$PORT/" || exit 1
COPY --from=builder /app .
CMD ["npm", "start"]