Yaroslav Shelomentsev
Posted on August 27, 2023
Dockerfile:
FROM node:20
RUN apt-get update \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
Then, you need to create local docker image:
docker build -t node20-ppt .
And, then, use it, for example in docker-compose.yml:
version: '3.8'
services:
my_api_with_puppeteer:
image: node20-ppt
container_name: my_api_with_puppeteer
working_dir: /srv/web
volumes:
- /srv/web:/srv/web
command: bash -c "yarn install && yarn start"
restart: always
💖 💪 🙅 🚩
Yaroslav Shelomentsev
Posted on August 27, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.