|
17 | 17 | ### Recommend to install with "docker build <GITHUB-REPO-LINK> -t TAGNAME", |
18 | 18 | ### grabs the latest copy of WPT and build time on average takes 10 minutes. |
19 | 19 |
|
20 | | -FROM ubuntu |
| 20 | +FROM ubuntu:22.04 as production |
| 21 | + |
| 22 | +### TIMEZONE INSIDE THE CONTAINER ### |
| 23 | +ARG TIMEZONE=UTC |
21 | 24 |
|
22 | 25 | ### PREVENTs INTERACTIVE PROMPTS WHILE INSTALLING ### |
23 | 26 | ARG DEBIAN_FRONTEND=noninteractive |
24 | 27 |
|
25 | | -### COPYING ENTIRE DIR TO LOCAL DOCKER /wptagent |
26 | | -#COPY / /wptagent |
27 | | -RUN apt-get update |
28 | | - |
29 | | -# Install software |
30 | | -RUN apt-get install -y git |
31 | | -RUN git clone -b master https://github.com/WPO-Foundation/wptagent.git |
32 | | -#COPY docker/linux-headless/entrypoint.sh /wptagent/entrypoint.sh |
33 | | - |
34 | 28 | ### UPDATE ### |
35 | | -RUN apt-get update |
| 29 | +RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - |
| 30 | +RUN apt update |
36 | 31 |
|
37 | 32 | ### INSTALL APT-GET LIBS ### |
38 | | -RUN xargs -a /wptagent/.github/workflows/docker-apt-get.txt apt-get install --no-install-recommends --yes |
| 33 | +# set default timezone beforehand to avoid user interaction for tzdata package |
| 34 | +RUN ln -fs /usr/share/zoneinfo/$TIMEZONE /etc/localtime && apt install -y \ |
| 35 | + git \ |
| 36 | + python3 python3-pip python3-ujson \ |
| 37 | + imagemagick dbus-x11 traceroute software-properties-common psmisc libnss3-tools iproute2 net-tools openvpn \ |
| 38 | + libtiff5-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \ |
| 39 | + python3-dev libavutil-dev libmp3lame-dev libx264-dev yasm autoconf automake build-essential libass-dev libfreetype6-dev libtheora-dev \ |
| 40 | + libtool libvorbis-dev pkg-config texi2html libtext-unidecode-perl python3-numpy python3-scipy perl \ |
| 41 | + adb ethtool nodejs cmake git-core libsdl2-dev libva-dev libvdpau-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev texinfo wget \ |
| 42 | + ttf-mscorefonts-installer fonts-noto fonts-roboto fonts-open-sans ffmpeg npm sudo curl xvfb |
| 43 | + |
| 44 | +# Get WPTAgent for dependecies |
| 45 | +RUN git clone -b master https://github.com/WPO-Foundation/wptagent.git |
39 | 46 |
|
40 | | -### UPGRADING PIP AND INSTALLING REQUIRED PACKAGES ### |
41 | | -RUN python3 -m pip install --upgrade --user pip && \ |
42 | | - python3 -m pip install --user -r /wptagent/.github/workflows/requirements.txt |
| 47 | +### UPDATE FONT CACHE ### |
| 48 | +RUN fc-cache -f -v |
43 | 49 |
|
44 | 50 | ### INSTALLING LIGHTHOUSE FROM NPM ### |
45 | 51 | RUN npm install -g lighthouse |
46 | 52 |
|
47 | 53 | ### INSTALLING CHROME BROWSER ### |
48 | | -### Fails to Find all libs needed to run |
49 | | -# RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ |
50 | | -# dpkg -i google-chrome-stable_current_amd64.deb; exit 0 && \ |
51 | | -# apt -f install -y && \ |
52 | | -# apt-get install google-chrome-stable |
| 54 | +RUN curl -o /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ |
| 55 | + apt install -y /tmp/google-chrome-stable_current_amd64.deb && rm /tmp/google-chrome-stable_current_amd64.deb |
53 | 56 |
|
54 | | -### BETTER INSTALLING CHROME BROWSER METHOD ### |
55 | | -### Better Installing method but would like to change this to something less complex. |
56 | | -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ |
57 | | - && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list |
58 | | -RUN apt-get update && apt-get -y install google-chrome-stable ; exit 0 |
59 | | -RUN apt-get update --fix-missing -y |
60 | | -RUN apt-get install -f -y |
| 57 | +### UPGRADING PIP AND INSTALLING REQUIRED PACKAGES ### |
| 58 | +RUN python3 -m pip install --upgrade --user pip && \ |
| 59 | + python3 -m pip install --user -r /wptagent/.github/workflows/requirements.txt |
61 | 60 |
|
62 | | -### CLEAN UP ### |
63 | | -# We could add some clean up here but in testing it was negotiable |
| 61 | +WORKDIR /wptagent |
64 | 62 |
|
| 63 | +ENTRYPOINT ["/bin/sh", "/wptagent/docker/linux-headless/entrypoint.sh"] |
65 | 64 |
|
66 | | -WORKDIR /wptagent |
| 65 | +### DEBUG CONTAINER ### |
| 66 | +# To build the debug container add `--target debug` as a build parameter |
| 67 | +FROM production as debug |
| 68 | + |
| 69 | +### INSTALLING DEBUG DEPENDENCIES ### |
| 70 | +RUN pip install debugpy |
| 71 | + |
| 72 | +### COPY DEBUG AGENT AND MOVE REAL ONE ### |
| 73 | +RUN mv wptagent.py wptagent_starter.py |
| 74 | +COPY wptagent_debug.py wptagent.py |
67 | 75 |
|
68 | | -### /bin/bash LOCATION OF COMMAND EXECUTION ### |
69 | | -#CMD ["python3","wptagent.py", "-vvvv", "--xvfb", "--server", "http://web/work/", "--location", "Test", "--key", "123456789"] |
| 76 | +### SETTING PRODUCTION BUILD AS DEFAULT ### |
| 77 | +FROM production |
0 commit comments