2024-07-27 18:04:21 +03:00
|
|
|
|
|
|
|
FROM node:20
|
|
|
|
|
|
|
|
# We don't need the standalone Chromium
|
|
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
|
|
# Set executable path for puppeteer
|
2024-08-12 15:52:30 +03:00
|
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
2024-07-27 18:04:21 +03:00
|
|
|
|
2024-08-12 15:52:30 +03:00
|
|
|
# Install Chromium and fonts
|
|
|
|
# https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md?plain=1#L397
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y gnupg wget dumb-init && \
|
|
|
|
apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 && \
|
2024-12-07 11:32:54 +03:00
|
|
|
apt-get install -y chromium-common/stable chromium/stable --no-install-recommends && \
|
2024-08-12 15:52:30 +03:00
|
|
|
apt-get clean
|
2024-07-27 18:04:21 +03:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
RUN npm install --ignore-scripts=false --verbose bufferutil utf-8-validate @mongodb-js/zstd snappy --unsafe-perm
|
2024-08-20 15:39:12 +03:00
|
|
|
COPY bundle/bundle.js ./
|
2024-07-27 18:04:21 +03:00
|
|
|
|
|
|
|
CMD [ "dumb-init", "node", "bundle.js" ]
|