Created
June 20, 2018 15:48
-
-
Save adamgotterer/4dba4b15e24f3938d0c17a3cc0b06e8a to your computer and use it in GitHub Desktop.
Puppeteer headless chrome with chroxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8-slim | |
ARG DEBIAN_FRONTEND=noninteractive | |
ENV PUPPETEER_VERSION 1.5.0 | |
ENV CHROXY_VERSION 0.3.2 | |
RUN apt-get update -qqy \ | |
&& apt-get -qqy install \ | |
unzip gnupg curl wget ca-certificates apt-transport-https \ | |
git ttf-wqy-zenhei g++ libzmq3-dev apt-utils vim \ | |
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* | |
RUN 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-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \ | |
--no-install-recommends \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& apt-get purge --auto-remove -y curl \ | |
&& rm -rf /src/*.deb | |
RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \ | |
&& dpkg -i erlang-solutions_1.0_all.deb | |
RUN apt-get update -qqy \ | |
&& apt-get install -y esl-erlang \ | |
&& apt-get install -y elixir \ | |
&& rm erlang-solutions_1.0_all.deb | |
RUN npm i puppeteer@$PUPPETEER_VERSION | |
RUN useradd headless --shell /bin/bash --create-home \ | |
&& usermod -a -G sudo headless \ | |
&& echo 'ALL ALL = NOPASSWD: ALL' >> /etc/sudoers \ | |
&& echo 'headless:nopassword' | chpasswd | |
RUN mkdir /data \ | |
&& chown -R headless:headless /data | |
USER headless | |
ENV SHELL /bin/sh | |
ENV LANG C.UTF-8 | |
ENV LC_ALL C.UTF-8 | |
WORKDIR /home/headless | |
RUN wget https://github.com/holsee/chroxy/archive/$CHROXY_VERSION.zip \ | |
&& unzip $CHROXY_VERSION.zip -d /home/headless | |
RUN mix local.hex --force && mix local.rebar --force | |
WORKDIR /home/headless/chroxy-$CHROXY_VERSION | |
RUN mix do deps.get --force, compile | |
CMD ["mix", "run", "--no-halt"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment