-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (30 loc) · 840 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (30 loc) · 840 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
27
28
29
30
31
32
33
34
35
36
37
FROM node:20.18-bookworm
# Create app directory
WORKDIR /usr/src/app
# Install build tools and canvas dependencies for native modules
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
pkg-config \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
&& rm -rf /var/lib/apt/lists/*
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
# Install dependencies - force rebuild of native modules from source
# Add cache-bust argument to force fresh install
ARG CACHEBUST=1
RUN npm cache clean --force && \
rm -rf node_modules && \
npm install --build-from-source
# Bundle app source
COPY . .
# Expose ports
EXPOSE 8080 443
CMD [ "npm", "start" ]