-
Notifications
You must be signed in to change notification settings - Fork 345
/
Dockerfile
32 lines (25 loc) · 712 Bytes
/
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
# Use the official Node.js Alpine image as the base image
FROM node:20-alpine
# Set the working directory
WORKDIR /usr/src/app
# Install Chromium
ENV CHROME_BIN="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true" \
NODE_ENV="production"
RUN set -x \
&& apk update \
&& apk upgrade \
&& apk add --no-cache \
udev \
ttf-freefont \
chromium
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install the dependencies
RUN npm ci --only=production --ignore-scripts
# Copy the rest of the source code to the working directory
COPY . .
# Expose the port the API will run on
EXPOSE 3000
# Start the API
CMD ["npm", "start"]