-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (48 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
60 lines (48 loc) · 1.27 KB
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
# Base image
FROM node:22-alpine3.20 AS base
# Working directory
WORKDIR /usr/src/app
# Install Python 3, build tools, pkg-config, and necessary dependencies for canvas
RUN apk add --no-cache \
python3 \
py3-pip \
make \
g++ \
bash \
pkgconf \
cairo-dev \
pango-dev \
pixman-dev \
jpeg-dev \
giflib-dev \
musl-dev
# Export port
EXPOSE 8080
FROM base AS dependencies
# Install dependencies early for Docker layer caching
COPY package*.json ./
RUN npm ci --silent
FROM dependencies AS chromiumdependencies
# Required for Puppeteer
RUN apk add --no-cache \
chromium=131.0.6778.108-r0 \
freetype=2.13.2-r0 \
freetype-dev=2.13.2-r0 \
harfbuzz=8.5.0-r0 \
ca-certificates=20250911-r0
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
FROM chromiumdependencies AS sourcechromium
# Copy the rest of the application code
COPY . .
FROM dependencies AS development
RUN npm i -g nodemon --save-dev
CMD ["npm", "run", "dev-networked-mount"]
FROM sourcechromium AS test
CMD ["npm", "run", "test"]
# For GH Actions only
FROM sourcechromium AS coverage-ci
CMD ["npm", "run", "coverage-lcov"]
# For local coverage
FROM sourcechromium AS coverage-local
CMD ["npm", "run", "coverage-local"]