-
-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathdocker-compose.dist.yml
More file actions
283 lines (228 loc) · 11.3 KB
/
Copy pathdocker-compose.dist.yml
File metadata and controls
283 lines (228 loc) · 11.3 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
services:
db:
image: mariadb:10.11
# Set a fixed container name, so it does not depend on the directory name
container_name: webwork2_db_1
volumes:
- mysql:/var/lib/mysql
# Set up UTF8MB4 in config file for the container.
# Needs to be done BEFORE the database is created.
# *** Some other MariaDB settings were modified in the sample file:
# wait_timeout, interactive_timeout, max_connections, net_read_timeout
# + skip-name-resolve
# Note: It seems different versions of the MariaDB container need
# this file in different locations. Put in in both places.
- './docker-config/db/mariadb.cnf:/etc/mysql/conf.d/mariadb.cnf'
- './docker-config/db/mariadb.cnf:/etc/mysql/mariadb.cnf'
# Tuning MariaDB config - sample file
# The sample file modifies wait_timeout, and adds skip-name-resolve
#- "./docker-config/db/my.cnf:/etc/mysql/my.cnf"
# Adjust open file limits for MariaDB/mySQL - sample file
#- "./docker-config/db/limits.conf:/etc/security/limits.conf"
# Provides read only access to the host system's /etc/localtime - tested on Linux hosts
#- "/etc/localtime:/etc/localtime:ro"
# The ulimits lines were only tested on Linux hosts in conjuction woth the limits.conf file
#ulimits:
# nofile:
# soft: 4096
# hard: 4096
restart: always
environment:
# When the MariaDB container is first started it will set the
# the MYSQL_ROOT_PASSWORD if there is no mysql database in the
# data volume.
MYSQL_ROOT_PASSWORD: ${WEBWORK_MYSQL_ROOT_PASSWORD}
# When the MariaDB container is first started it will create
# the WW database and WW DB user based on:
MYSQL_DATABASE: webwork
MYSQL_USER: ${WEBWORK_DB_USER}
MYSQL_PASSWORD: ${WEBWORK_DB_PASSWORD}
# A timezone for the DB server can be set:
#TZ: zone/city
# where zone/city must be a valid setting.
# "/usr/bin/timedatectl list-timezones" on an Ubuntu system with
# that tool installed will find valid values.
# See: https://stackoverflow.com/questions/39172652/using-docker-compose-to-set-containers-timezones
app:
# Modifying the image name can be helpful to create a new image instead of
# overwriting the "standard" one during testing.
image: webwork
# Set a fixed container name, so it does not depend on the directory name
container_name: webwork2_app_1
# Set up the "build:" configuration:
build:
# For use/building when docker-compose.yml is in the webwork2 directory
context: .
# For use/building when docker-compose.yml is OUTSIDE the webwork2 directory.
# For example, if multiple hosts use a NFS shared webwork2/ directory, and
# each one needs customized values in docker-compose.yml.
# Under typical use, the Dockerfile should not need to be customized per host,
# but may contain some changes/additions relative to the standard webwork image.
#
# context: /Path_To/webwork2/
# dockerfile: /Path_To/Dockerfile
args:
# Build args to set the source Git repositories. Here we set the main repositories:
- WEBWORK2_GIT_URL=https://github.com/openwebwork/webwork2.git
- PG_GIT_URL=https://github.com/openwebwork/pg.git
# Build args specifying the branches of webwork2 and pg to install.
# Exactly one pair of settings should be left uncommented and all the others
# should be commented out.
# main branches:
- WEBWORK2_BRANCH=main
- PG_BRANCH=main
# WeBWorK/PG develop branches
# (other valid branches can also be used in a similar manner)
#- WEBWORK2_BRANCH=develop
#- PG_BRANCH=develop
# If you would like a 1 stage build process comment out the next line, and just run "docker-compose build".
dockerfile: DockerfileStage2
# For the 2 stage build process run
# docker build --tag webwork-base:forWW221 -f DockerfileStage1 .
# and then
# docker-compose build
# When rebuilding to get updated images add the "--no-cache" option to both commands.
# You can add something like
# --build-arg ADDITIONAL_BASE_IMAGE_PACKAGES="nano less"
# to the stage 1 "docker build" command to include extra OS packages in the base image.
# That approach makes them (persistent) so available immediately each time a container is
# started and is thus faster than adding them in when a container is started via the
# ADD_APT_PACKAGES setting below.
depends_on:
- db
- r
volumes:
# ======================================================================
# If you are using locally modified webwork2 files, then
# either mount them from the webwork2 tree from which you start Docker:
#- ".:/opt/webwork/webwork2"
# OR mount it from a fixed external location
#- "/path_to/webwork2:/opt/webwork/webwork2"
# Shared main /pg repository - allows local PG development
#- "/path_to_shared/pg:/opt/webwork/pg"
# OR locally modified PG directory
#- "../pg:/opt/webwork/pg"
# ======================================================================
# Sometimes it is helpful to mount certain webwork2/conf files from elsewhere
# so the main contents of webwork2 can be shared by several hosts (ex. NFS)
#- "/per_host_conf_path/conf/authen_LTI.conf:/opt/webwork/webwork2/conf/authen_LTI.conf"
#- "/per_host_conf_path/conf/localOverrides.conf:/opt/webwork/webwork2/conf/localOverrides.conf"
#- "/per_host_conf_path/conf/site.conf:/opt/webwork/webwork2/conf/site.conf"
# webwork2 misc LOCAL files - mount live (per host) so NOT in the main webwork2 location
#- "/per_host_conf_path/htdocs/my_site_info.txt:/opt/webwork/webwork2/htdocs/my_site_info.txt"
# webwork2 LOCAL logs and htdocs/tmp directories (per host)
#- "/per_host_data_path/webwork2/logs:/opt/webwork/webwork2/logs"
#- "/per_host_data_path/webwork2/htdocs/tmp:/opt/webwork/webwork2/htdocs/tmp"
# By default mount the courses tree in a separate tree outside of webwork2/ as follows:
- '${COURSES_DIRECTORY_ON_HOST}:/opt/webwork/courses'
# OR use the following mount if the hosts have different courses on them:
#- "/per_host_data_path/courses/:/opt/webwork/courses/"
# ======================================================================
# Mojolicious webwork2 app configuration. For production you will need to modify this file.
# Note that the SSL configuration is done in this file.
# See https://docs.mojolicious.org/Mojo/Server/Daemon#listen for how to do this.
#- "/per_host_conf_path/conf/webwork2.mojolicious.yml:/opt/webwork/webwork2/conf/webwork2.mojolicious.yml"
# SSL certificates (subdirectory with certificate and key)
# Place your ssl certificate files used in webwork2.mojolicious.yml above in docker-config/ssl,
# or change the mount location to where your ssl certificate files reside.
#- "./docker-config/ssl/:/etc/ssl/local"
# ======================================================================
# By default the OPL is stored in a named Docker storage volume:
- oplVolume:/opt/webwork/libraries/webwork-open-problem-library
#
# as an alternative, you can comment out the prior option and uncomment the line below to use
# a local directory containing the OPL
#- "/path_to/webwork-open-problem-library:/opt/webwork/libraries/webwork-open-problem-library"
# ======================================================================
hostname: myhost.mydomain.edu
ports:
# For a personal machine
- '${WEBWORK2_HTTP_PORT_ON_HOST}:8080'
# For a production machine
#- "80:8080"
#- "443:8080"
# For a production machine
#restart: always
stop_signal: SIGWINCH
stop_grace_period: 30s
environment:
# Standard database environment variables needed by WeBWorK:
# Select which DBD driver to use
WEBWORK_DB_DRIVER: MariaDB
# WEBWORK_DB_DRIVER: mysql
WEBWORK_DB_HOST: db
WEBWORK_DB_PORT: 3306
WEBWORK_DB_NAME: webwork
# These are set in the .env file and import values from there
WEBWORK_DB_PASSWORD: ${WEBWORK_DB_PASSWORD}
WEBWORK_DB_USER: ${WEBWORK_DB_USER}
# =======================================================
# Local configuration variables:
# To turn on SSL in the running container
#SSL: 1
# Control settings for error message handling by webwork2/lib/WeBWorK.pm
# The standard behavior is with both of these set to 0
MIN_HTML_ERRORS: 0
JSON_ERROR_LOG: 0
# Change to A4 paper
#PAPERSIZE: a4
# Use to build additional locales in the running container at startup. Ex:
#ADD_LOCALES: "he_IL ISO-8859-8\nhe_IL.UTF-8 UTF-8\n"
# Extra Ubuntu packages to install during container startup.
#
# Uncommenting the ADD_APT_PACKAGES line and put the list of additional
# Ubuntu packages to install on the line.
#
# This is best used when you have a temporary need for additional
# packages, as using the ADD_APT_PACKAGES option will slow down the
# container startup time.
#
# OS packages you want frequently available are better added using the
# build time ADDITIONAL_BASE_IMAGE_PACKAGES setting described above.
#ADD_APT_PACKAGES: nano less
# The system timezone for the container can be set using
#SYSTEM_TIMEZONE: zone/city
# where zone/city must be a valid setting.
# "/usr/bin/timedatectl list-timezones" on an Ubuntu system with
# that tool installed will find valid values.
# =======================================================
# If you use https below, make sure to set up the certificate and SSL configuration
# Note if your server uses a non-standard port, that should also be included.
#WEBWORK_ROOT_URL: https://myhost.mydomain.edu
#WEBWORK_SMTP_SERVER: smtp.mydomain.edu
#WEBWORK_SMTP_SENDER: support@mydomain.edu
#WEBWORK_TIMEZONE: America/New_York
r:
image: ubcctlt/rserve
# The R server need not be available from outside the local Docker network.
#ports:
# - "6311:6311"
# SimpleSAMLphp Saml2 identity provider for development use only. This is a separate profile from the other services
# so it doesn't start in normal usage. Use "docker compose --profile saml2dev up" to start, "docker compose --profile
# saml2dev stop" to stop services, and "docker compose --profile saml2dev down" to stop services and remove
# containers.
idp:
build:
context: ./docker-config/idp/
profiles:
- saml2dev
ports:
- '8180:80'
environment:
SP_METADATA_URL: 'http://app:8080/webwork2/saml2/metadata'
# The healthcheck url is SimpleSAMLphp's url for triggering cron jobs. The cron job it triggers will
# automatically fetch the webwork2 service provider's metadata.
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost/simplesaml/module.php/cron/run/metarefresh/webwork2']
start_period: 1m
start_interval: 15s
interval: 1h
retries: 1
timeout: 10s
volumes:
oplVolume:
driver: local
name: webwork2_oplVolume
mysql:
driver: local
name: webwork2_mysql