Skip to content

Commit

Permalink
Use puppeteer official image
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Dec 11, 2024
1 parent 2229bb4 commit 4202acd
Show file tree
Hide file tree
Showing 3 changed files with 642 additions and 749 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.github
.idea
Screenshot.png
37 changes: 11 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,27 @@
# Inspired by: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

FROM node:lts-slim

# 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 Chromium that Puppeteer
# installs, work.
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/*
# https://github.com/puppeteer/puppeteer/tree/main/docker

FROM ghcr.io/puppeteer/puppeteer:23

USER root

# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise
# uncomment the following lines to have `dumb-init` as PID 1
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
ENTRYPOINT ["dumb-init", "--"]

RUN groupadd -r pptruser \
&& useradd -r -g pptruser pptruser \
&& mkdir -p /home/pptruser/puppet-show \
&& chown -R pptruser:pptruser /home/pptruser
COPY . /home/pptruser/puppet-show
WORKDIR /home/pptruser/puppet-show

# Corporate SSL proxy
RUN npm config set strict-ssl false -g
RUN chown -R pptruser:pptruser /home/pptruser/puppet-show

# Run everything after as non-privileged user.
USER pptruser

WORKDIR /home/pptruser/puppet-show

RUN npm install puppet-show
# Install puppet-show deps from package-lock.json
RUN npm ci .

EXPOSE 3000

CMD ["node", "node_modules/puppet-show/bin/www"]
CMD ["node", "bin/www"]

# Now navigate web browser to http://localhost:3000/puppet-show/
Loading

0 comments on commit 4202acd

Please sign in to comment.