-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
90 lines (76 loc) · 2.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Parent image
FROM --platform=linux/amd64 ubuntu:20.04
LABEL name "openassessit"
LABEL maintainer Joel Crawford-Smith <[email protected]>
LABEL version "1"
LABEL release "1"
LABEL summary "OpenAssessIt Quickstart"
LABEL Description "OpenAssessIt Process JSON Lighthouse reports into markdown files with images of failing items."
ENV DEBIAN_FRONTEND noninteractive
# Set the working directory to /app
WORKDIR /app
# Install apps
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
--no-install-recommends \
&& curl -sSL https://deb.nodesource.com/setup_16.x | bash - \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install -y \
fontconfig \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-thai-tlwg \
fonts-kacst \
fonts-symbola \
fonts-noto \
fonts-freefont-ttf \
fonts-liberation \
nodejs \
wget \
git \
# firefox-esr \
python3-setuptools \
python3-pip \
zip \
unzip \
libnss3 \
libdrm2 \
libgbm1 \
xdg-utils \
--no-install-recommends \
&& apt-get purge --auto-remove -y curl gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb && apt-get -fy install
RUN rm google-chrome-stable_current_amd64.deb
# Install Lighthouse cli
RUN npm --global install -y [email protected] \
&& npm cache clean --force
# Clone OpenAssessIt repos
RUN git clone https://github.com/OpenAssessItToolkit/openassessit.git
RUN git clone https://github.com/OpenAssessItToolkit/openassessit_templates.git
# Install any needed packages specified in openassessits requirements.txt
RUN pip3 install wheel
RUN pip3 install -r openassessit/requirements.txt
# Gecko Driver
RUN wget -q "https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz" -O /tmp/geckodriver.tgz
RUN tar -xvzf /tmp/geckodriver.tgz
RUN rm /tmp/geckodriver.tgz
RUN chmod +x geckodriver
RUN mv geckodriver /usr/bin/
# Chrome Driver
RUN wget -q "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-arm64/chromedriver-mac-arm64.zip" -O /tmp/chromedriver.zip
RUN unzip /tmp/chromedriver.zip
RUN rm /tmp/chromedriver.zip
RUN chmod +x chromedriver
RUN mv chromedriver /usr/bin/
# Define environment variable
ENV NAME openassessit
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]