Advertisement
daniilak

Untitled

May 27th, 2022
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. FROM python:3.7
  2.  
  3. COPY . /app
  4. WORKDIR /app
  5. # assuming repo is up to date on host machine
  6. RUN apt update -y && apt-get install -y \
  7. build-essential \
  8. xvfb \
  9. libicu-dev \
  10. build-essential \
  11. libpcre3 \
  12. libpcre3-dev && \
  13. pip install pip --upgrade
  14. RUN pip install -r requirements.txt
  15. RUN export DISPLAY=:0
  16. RUN /usr/bin/Xvfb :0 -screen 0 1024x768x24 &
  17. RUN sleep 5
  18. # create unprivileged user
  19. RUN adduser --disabled-password --gecos '' myuser
  20.  
  21. # install google chrome
  22. RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
  23. RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
  24. RUN apt-get -y update
  25. RUN apt-get install -y google-chrome-stable
  26.  
  27. # install chromedriver
  28. RUN apt-get install -yqq unzip
  29. RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
  30. RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
  31.  
  32. ENV DISPLAY=:99
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement