1- FROM node:20
1+ FROM ghcr.io/puppeteer/puppeteer:23
22
3- # Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
4- # Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
5- # installs, work.
6- RUN apt-get update \
7- && apt-get install -y wget gnupg \
8- && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
9- && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
10- && apt-get update \
11- && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
12- --no-install-recommends \
13- && rm -rf /var/lib/apt/lists/*
14-
15- # If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise
16- # uncomment the following lines to have `dumb-init` as PID 1
17- # ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/local/bin/dumb-init
18- # RUN chmod +x /usr/local/bin/dumb-init
19- # ENTRYPOINT ["dumb-init", "--"]
20-
21- # Uncomment to skip the chromium download when installing puppeteer. If you do,
22- # you'll need to launch puppeteer with:
23- # browser.launch({executablePath: 'google-chrome-stable'})
24- # ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
3+ USER root
254RUN mkdir -p /home/test
26- RUN groupadd -r test && useradd -r -g test -G audio,video test \
27- && chown -R test:test /home/test
5+ RUN chown -R pptruser /home/test
286WORKDIR /home/test
29- USER test
7+ # Install Chrome for the root user: Codefresh runs the container as root
8+ RUN npx puppeteer browsers install chrome
9+
10+ USER pptruser
3011COPY package.json .
3112COPY yarn.lock .
3213RUN yarn install --timeout 99999999
3314
15+ COPY --chown=pptruser . .
16+ ENV APP_URL=https://github.com
3417
35- # Run everything after as non-privileged user.
36-
37-
38- COPY --chown=test . .
39- USER test
4018CMD ["yarn" , "test" ]
0 commit comments