Skip to content

Commit b9b4e45

Browse files
authored
Merge pull request #1437 from openwebwork/WeBWorK-2.16
WeBWork 2.16 Release
2 parents 9f31811 + 75cc0fb commit b9b4e45

File tree

1,630 files changed

+63776
-354055
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,630 files changed

+63776
-354055
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ COURSES_DIRECTORY_ON_HOST=../ww-docker-data/courses
22
WEBWORK2_HTTP_PORT_ON_HOST=8080
33
WEBWORK_DB_USER=webworkWrite
44
WEBWORK_DB_PASSWORD=passwordRWsetItBeforeFirstStartingTheDBcontainer
5+
WEBWORK_MYSQL_ROOT_PASSWORD=sqlRootPasswordSetThisPasswordBEFOREfirstStartingTheDBcontainer

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
*.conf
22
*-config
3+
.env
34
applets
45
tmp
56
logs
6-
courses.dist
77
library-directory-tree.json
88
library-subject-tree.json
99
textbook-tree.json
@@ -30,6 +30,9 @@ WeBWorK.sublime-workspace
3030
conf/*.apache-config
3131
math4-overrides.css
3232
math4-overrides.js
33+
htdocs/themes/math4/images/*
34+
htdocs/themes/math4-green/images/*
35+
htdocs/themes/math4-red/images/*
3336
DATA/*
3437
*.swp
3538
.dump_past_answers_salt

Dockerfile

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,23 @@
4040
FROM alpine/git AS base
4141

4242
# build args specifying the branches for webwork2 and pg used to build the image
43-
44-
# To use the master branches of webwork2 and pg
45-
ARG WEBWORK2_GIT_URL=https://github.com/openwebwork/webwork2.git
46-
ARG WEBWORK2_BRANCH=master
47-
ARG PG_GIT_URL=https://github.com/openwebwork/pg.git
48-
ARG PG_BRANCH=master
49-
50-
# assign the build args to the ENV variables
51-
ENV WEBWORK2_GIT_URL_ENV ${WEBWORK2_GIT_URL}
52-
ENV WEBWORK2_BRANCH_ENV ${WEBWORK2_BRANCH}
53-
ENV PG_GIT_URL_ENV ${PG_GIT_URL}
54-
ENV PG_BRANCH_ENV ${PG_BRANCH}
43+
ARG WEBWORK2_GIT_URL
44+
ARG WEBWORK2_BRANCH
45+
ARG PG_GIT_URL
46+
ARG PG_BRANCH
5547

5648
WORKDIR /opt/base
5749

58-
RUN echo Cloning branch $WEBWORK2_BRANCH_ENV from $WEBWORK2_GIT_URL_ENV \
59-
&& echo git clone --single-branch --branch ${WEBWORK2_BRANCH_ENV} --depth 1 $WEBWORK2_GIT_URL_ENV \
60-
&& git clone --single-branch --branch ${WEBWORK2_BRANCH_ENV} --depth 1 $WEBWORK2_GIT_URL_ENV \
50+
RUN echo Cloning branch $WEBWORK2_BRANCH from $WEBWORK2_GIT_URL \
51+
&& echo git clone --single-branch --branch ${WEBWORK2_BRANCH} --depth 1 $WEBWORK2_GIT_URL \
52+
&& git clone --single-branch --branch ${WEBWORK2_BRANCH} --depth 1 $WEBWORK2_GIT_URL \
6153
&& rm -rf webwork2/.git webwork2/{*ignore,Dockerfile,docker-compose.yml,docker-config}
6254

63-
RUN echo Cloning branch $PG_BRANCH_ENV branch from $PG_GIT_URL_ENV \
64-
&& echo git clone --single-branch --branch ${PG_BRANCH_ENV} --depth 1 $PG_GIT_URL_ENV \
65-
&& git clone --single-branch --branch ${PG_BRANCH_ENV} --depth 1 $PG_GIT_URL_ENV \
55+
RUN echo Cloning branch $PG_BRANCH branch from $PG_GIT_URL \
56+
&& echo git clone --single-branch --branch ${PG_BRANCH} --depth 1 $PG_GIT_URL \
57+
&& git clone --single-branch --branch ${PG_BRANCH} --depth 1 $PG_GIT_URL \
6658
&& rm -rf pg/.git
6759

68-
RUN git clone --single-branch --branch legacy-v2 --depth 1 https://github.com/mathjax/MathJax \
69-
&& rm -rf MathJax/.git
70-
7160
# Optional - include OPL (also need to uncomment further below when an included OPL is desired):
7261
#RUN git clone --single-branch --branch master --depth 1 https://github.com/openwebwork/webwork-open-problem-library.git \
7362
# && rm -rf webwork-open-problem-library/.git
@@ -78,7 +67,7 @@ RUN git clone --single-branch --branch legacy-v2 --depth 1 https://github.com/ma
7867

7968
# we need to change FROM before setting the ENV variables
8069

81-
FROM ubuntu:18.04
70+
FROM ubuntu:20.04
8271

8372
ENV WEBWORK_URL=/webwork2 \
8473
WEBWORK_ROOT_URL=http://localhost \
@@ -106,14 +95,10 @@ ENV WEBWORK_ROOT=$APP_ROOT/webwork2 \
10695

10796
# ==================================================================
10897

109-
# Phase 3 - Ubuntu 18.04 base image + required packages
98+
# Phase 3 - Ubuntu 20.04 base image + required packages
11099

111-
# Packages changes/added for ubuntu 18.04:
112-
113-
# For ubuntu 18.04 libemail-address-xs-perl installed from Ubuntu, for 16.04 it would be installed using cpamn
114-
#
115-
# texlive-generic-recommended # For ubuntu 16.04 - contains path.sty
116-
# texlive-plain-generic # For ubuntu 18.04 - contains path.sty
100+
# Packages changes/added for ubuntu 20.04:
101+
# libcgi-pm-perl (for CGI::Cookie), libdbd-mariadb-perl
117102

118103
# Do NOT include "apt-get -y upgrade"
119104
# see: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
@@ -123,13 +108,15 @@ RUN apt-get update \
123108
apache2 \
124109
curl \
125110
dvipng \
111+
dvisvgm \
126112
gcc \
127113
libapache2-request-perl \
114+
libarchive-zip-perl \
115+
libcgi-pm-perl \
128116
libcrypt-ssleay-perl \
129117
libdatetime-perl \
130-
libdancer-perl \
131-
libdancer-plugin-database-perl \
132118
libdbd-mysql-perl \
119+
libdbd-mariadb-perl \
133120
libemail-address-xs-perl \
134121
libexception-class-perl \
135122
libextutils-xsbuilder-perl \
@@ -148,6 +135,8 @@ RUN apt-get update \
148135
libpath-class-perl \
149136
libphp-serialization-perl \
150137
libxml-simple-perl \
138+
libnet-https-nb-perl \
139+
libhttp-async-perl \
151140
libsoap-lite-perl \
152141
libsql-abstract-perl \
153142
libstring-shellquote-perl \
@@ -190,9 +179,12 @@ RUN apt-get update \
190179
libuniversal-isa-perl \
191180
libtest-fatal-perl \
192181
libjson-xs-perl \
193-
libmoox-options-perl \
182+
libjson-maybexs-perl \
183+
libcpanel-json-xs-perl \
194184
make \
195185
netpbm \
186+
patch \
187+
pdf2svg \
196188
preview-latex-style \
197189
texlive \
198190
texlive-latex-extra \
@@ -214,23 +206,25 @@ RUN apt-get update \
214206
fonts-linuxlibertine \
215207
lmodern \
216208
zip \
209+
iputils-ping \
210+
imagemagick \
217211
jq \
212+
npm \
218213
&& apt-get clean \
219214
&& rm -fr /var/lib/apt/lists/* /tmp/*
220215

221216
# Developers may want to add additional packages inside the image
222-
# such as: telnet vimvim mc file
217+
# such as: telnet vim mc file
223218

224219
# ==================================================================
225220

226-
# Phase 4 - Install webwork2, pg, MathJaX which were downloaded to /opt/base/ in phase 1
221+
# Phase 4 - Install webwork2 and pg which were downloaded to /opt/base/ in phase 1
227222
# Option: Install the OPL in the image also (about 850 MB)
228223

229224
RUN mkdir -p $APP_ROOT/courses $APP_ROOT/libraries $APP_ROOT/libraries/webwork-open-problem-library $APP_ROOT/webwork2 /www/www/html
230225

231226
COPY --from=base /opt/base/webwork2 $APP_ROOT/webwork2
232227
COPY --from=base /opt/base/pg $APP_ROOT/pg
233-
COPY --from=base /opt/base/MathJax $APP_ROOT/MathJax
234228

235229
# Optional - include OPL (also need to uncomment above to clone from GitHub when needed):
236230
# ??? could/should this include the main OPL = /opt/base/webwork-open-problem-library/OpenProblemLibrary and not Contrib and Pending ???
@@ -245,6 +239,7 @@ COPY --from=base /opt/base/MathJax $APP_ROOT/MathJax
245239
# 3. Some chown/chmod for material INSIDE the image.
246240
# 4. Build some standard locales.
247241
# 5. Set the default system timezone to be UTC.
242+
# 6. Install third party javascript files.
248243

249244
RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
250245
&& cd $APP_ROOT/pg/lib/chromatic && gcc color.c -o color \
@@ -256,7 +251,9 @@ RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
256251
&& echo "locales locales/default_environment_locale select en_US.UTF-8\ndebconf debconf/frontend select Noninteractive" > /tmp/preseed.txt \
257252
&& debconf-set-selections /tmp/preseed.txt \
258253
&& rm /etc/localtime /etc/timezone && echo "Etc/UTC" > /etc/timezone \
259-
&& dpkg-reconfigure -f noninteractive tzdata
254+
&& dpkg-reconfigure -f noninteractive tzdata \
255+
&& cd $WEBWORK_ROOT/htdocs \
256+
&& npm install
260257

261258
# These lines were moved into docker-entrypoint.sh so the bind mount of courses will be available
262259
#RUN cd $APP_ROOT/webwork2/courses.dist \
@@ -270,11 +267,6 @@ RUN echo "PATH=$PATH:$APP_ROOT/webwork2/bin" >> /root/.bashrc \
270267
RUN cpanm install Statistics::R::IO \
271268
&& rm -fr ./cpanm /root/.cpanm /tmp/*
272269

273-
# Now installed from Ubuntu packages:
274-
# XML::Parser::EasyTree Iterator Iterator::Util Pod::WSDL Array::Utils HTML::Template Mail::Sender Email::Sender::Simple Data::Dump
275-
# For Ubuntu 16.04 would also need:
276-
# Email::Address::XS
277-
278270
# ==================================================================
279271

280272
# Phase 7 - setup apache
@@ -285,6 +277,10 @@ RUN cpanm install Statistics::R::IO \
285277
# Always provide the dummy default-ssl.conf file:
286278
COPY docker-config/ssl/default-ssl.conf /etc/apache2/sites-available/default-ssl.conf
287279

280+
# Patch files that are applied below
281+
COPY docker-config/xmlrpc-lite-utf8-fix.patch /tmp
282+
COPY docker-config/imagemagick-allow-pdf-read.patch /tmp
283+
288284
# However SSL will only be enabled at container startup via docker-entrypoint.sh.
289285

290286
RUN cd $APP_ROOT/webwork2/conf \
@@ -303,13 +299,20 @@ RUN cd $APP_ROOT/webwork2/conf \
303299
&& sed -i -e 's/^<Perl>$/\
304300
PerlPassEnv WEBWORK_URL\n\
305301
PerlPassEnv WEBWORK_ROOT_URL\n\
306-
PerlPassEnv WEBWORK_DB_DSN\n\
302+
PerlPassEnv WEBWORK_DB_DRIVER\n\
303+
PerlPassEnv WEBWORK_DB_NAME\n\
304+
PerlPassEnv WEBWORK_DB_HOST\n\
305+
PerlPassEnv WEBWORK_DB_PORT\n\
307306
PerlPassEnv WEBWORK_DB_USER\n\
308307
PerlPassEnv WEBWORK_DB_PASSWORD\n\
309308
PerlPassEnv WEBWORK_SMTP_SERVER\n\
310309
PerlPassEnv WEBWORK_SMTP_SENDER\n\
311310
PerlPassEnv WEBWORK_TIMEZONE\n\
312-
\n<Perl>/' /etc/apache2/conf-enabled/webwork.conf
311+
\n<Perl>/' /etc/apache2/conf-enabled/webwork.conf \
312+
&& patch -p1 -d / < /tmp/xmlrpc-lite-utf8-fix.patch \
313+
&& rm /tmp/xmlrpc-lite-utf8-fix.patch \
314+
&& patch -p1 -d / < /tmp/imagemagick-allow-pdf-read.patch \
315+
&& rm /tmp/imagemagick-allow-pdf-read.patch
313316

314317
EXPOSE 80
315318
WORKDIR $APP_ROOT

DockerfileStage1

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# This is the Stage 1 Dockerfile, which builds a base OS image (webwork-base)
2+
# on top of which the WeBWorK parts will be installed by the Stage 2 Dockerfile.
3+
4+
FROM ubuntu:20.04
5+
6+
# ==================================================================
7+
8+
# Phase 1 - set base OS image install stage ENV variables
9+
#
10+
# We only need install time ENV variables, not those needed by the WeBWorK system
11+
12+
ENV DEBIAN_FRONTEND=noninteractive \
13+
DEBCONF_NONINTERACTIVE_SEEN=true
14+
15+
# ==================================================================
16+
17+
# Phase 2 - Ubuntu 20.04 base image + required packages
18+
19+
# Packages changes/added for ubuntu 20.04:
20+
# libcgi-pm-perl (for CGI::Cookie), libdbd-mariadb-perl
21+
22+
# Do NOT include "apt-get -y upgrade"
23+
# see: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
24+
25+
RUN apt-get update \
26+
&& apt-get install -y --no-install-recommends --no-install-suggests \
27+
apache2 \
28+
curl \
29+
dvipng \
30+
dvisvgm \
31+
gcc \
32+
libapache2-request-perl \
33+
libarchive-zip-perl \
34+
libcgi-pm-perl \
35+
libcrypt-ssleay-perl \
36+
libdatetime-perl \
37+
libdbd-mysql-perl \
38+
libdbd-mariadb-perl \
39+
libemail-address-xs-perl \
40+
libexception-class-perl \
41+
libextutils-xsbuilder-perl \
42+
libfile-find-rule-perl-perl \
43+
libgd-perl \
44+
libhtml-scrubber-perl \
45+
libjson-perl \
46+
liblocale-maketext-lexicon-perl \
47+
libmail-sender-perl \
48+
libmime-tools-perl \
49+
libnet-ip-perl \
50+
libnet-ldap-perl \
51+
libnet-oauth-perl \
52+
libossp-uuid-perl \
53+
libpadwalker-perl \
54+
libpath-class-perl \
55+
libphp-serialization-perl \
56+
libxml-simple-perl \
57+
libnet-https-nb-perl \
58+
libhttp-async-perl \
59+
libsoap-lite-perl \
60+
libsql-abstract-perl \
61+
libstring-shellquote-perl \
62+
libtemplate-perl \
63+
libtext-csv-perl \
64+
libtimedate-perl \
65+
libuuid-tiny-perl \
66+
libxml-parser-perl \
67+
libxml-writer-perl \
68+
libxmlrpc-lite-perl \
69+
libapache2-reload-perl \
70+
cpanminus \
71+
libxml-parser-easytree-perl \
72+
libiterator-perl \
73+
libiterator-util-perl \
74+
libpod-wsdl-perl \
75+
libtest-xml-perl \
76+
libmodule-build-perl \
77+
libxml-semanticdiff-perl \
78+
libxml-xpath-perl \
79+
libpath-tiny-perl \
80+
libarray-utils-perl \
81+
libhtml-template-perl \
82+
libtest-pod-perl \
83+
libemail-sender-perl \
84+
libmail-sender-perl \
85+
libmodule-pluggable-perl \
86+
libemail-date-format-perl \
87+
libcapture-tiny-perl \
88+
libthrowable-perl \
89+
libdata-dump-perl \
90+
libfile-sharedir-install-perl \
91+
libclass-tiny-perl \
92+
libtest-requires-perl \
93+
libtest-mockobject-perl \
94+
libtest-warn-perl \
95+
libsub-uplevel-perl \
96+
libtest-exception-perl \
97+
libuniversal-can-perl \
98+
libuniversal-isa-perl \
99+
libtest-fatal-perl \
100+
libjson-xs-perl \
101+
libjson-maybexs-perl \
102+
libcpanel-json-xs-perl \
103+
make \
104+
netpbm \
105+
patch \
106+
pdf2svg \
107+
preview-latex-style \
108+
texlive \
109+
texlive-latex-extra \
110+
texlive-plain-generic \
111+
texlive-xetex \
112+
texlive-latex-recommended \
113+
texlive-lang-other \
114+
texlive-lang-arabic \
115+
libc6-dev \
116+
git \
117+
mysql-client \
118+
tzdata \
119+
apt-utils \
120+
locales \
121+
debconf-utils \
122+
ssl-cert \
123+
ca-certificates \
124+
culmus \
125+
fonts-linuxlibertine \
126+
lmodern \
127+
zip \
128+
iputils-ping \
129+
imagemagick \
130+
jq \
131+
npm \
132+
&& apt-get clean \
133+
&& rm -fr /var/lib/apt/lists/* /tmp/*
134+
135+
# Developers may want to add additional packages inside the image
136+
# such as: telnet vim mc file
137+
138+
# ==================================================================
139+
140+
# Phase 3 - install additional Perl modules from CPAN (not packaged for Ubuntu or outdated in Ubuntu)
141+
142+
RUN cpanm install Statistics::R::IO \
143+
&& rm -fr ./cpanm /root/.cpanm /tmp/*
144+
145+
# ==================================================================
146+

0 commit comments

Comments
 (0)