FROM arm64v8/node:19
# Docker Puppeteer reference:
# https://pptr.dev/guides/docker
# https://github.com/puppeteer/puppeteer/blob/main/docker/Dockerfile
# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chrome that Puppeteer
# installs, work.
RUN apt-get update --no-install-recommends\
&& apt-get install -y --no-install-recommends wget gnupg \
&& apt-get install -y chromium fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Create app/working/bot directory
RUN mkdir -p /app
WORKDIR /app
# Install app production dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm ci --omit=dev
# Bundle app source
COPY . ./
# Optional API/Backend port
EXPOSE 3000
# Run the start command
CMD [ "npm", "run", "start" ]