Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM python:3.7
- COPY . /app
- WORKDIR /app
- # assuming repo is up to date on host machine
- RUN apt update -y && apt-get install -y \
- build-essential \
- xvfb \
- libicu-dev \
- build-essential \
- libpcre3 \
- libpcre3-dev && \
- pip install pip --upgrade
- RUN pip install -r requirements.txt
- RUN export DISPLAY=:0
- RUN /usr/bin/Xvfb :0 -screen 0 1024x768x24 &
- RUN sleep 5
- # create unprivileged user
- RUN adduser --disabled-password --gecos '' myuser
- # install google chrome
- RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
- RUN apt-get -y update
- RUN apt-get install -y google-chrome-stable
- # install chromedriver
- RUN apt-get install -yqq unzip
- RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
- RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
- ENV DISPLAY=:99
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement