Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Chrome as headless browser #931

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions webshot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
FROM node:16.14.0-alpine3.15
FROM node:16.14.0
LABEL maintainer="hello@vizzuality.com"

ENV NAME marxan-webshot
ENV USER $NAME
ENV APP_HOME /opt/$NAME

RUN addgroup $USER && adduser -s /bin/bash -D -G $USER $USER

RUN apk add --update \
bash \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
&& rm -rf /var/cache/apk/*

# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list

RUN apt-get update && apt-get install -y google-chrome-stable libxtst6 libxss1 --no-install-recommends

# Add Chrome as a user
RUN groupadd -r $USER && useradd -r -g $USER -G audio,video $USER \
&& mkdir -p /home/$USER && chown -R $USER:$USER /home/$USER

WORKDIR $APP_HOME
RUN chown $USER:$USER $APP_HOME
Expand Down