File tree Expand file tree Collapse file tree 4 files changed +35
-2
lines changed Expand file tree Collapse file tree 4 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ You can change the configuration of the docker images by setting various environ
130130| ` MOODLE_DOCKER_WEB_HOST ` | no | any valid hostname | localhost | The hostname for web |
131131| ` MOODLE_DOCKER_WEB_PORT ` | no | any integer value | 8000 | The port number for web. If set to 0, no port is used |
132132| ` MOODLE_DOCKER_SELENIUM_VNC_PORT ` | no | any integer value | not set | If set, the selenium node will expose a vnc session on the port specified |
133+ | ` MOODLE_DOCKER_TRAEFIK ` | no | any value | not set | If set, integrate the docker containers in traefik |
133134
134135## Advanced usage
135136
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ dockercompose="${dockercompose} -f ${basedir}/service.mail.yml"
3131# PHP Version.
3232export MOODLE_DOCKER_PHP_VERSION=${MOODLE_DOCKER_PHP_VERSION:- 7.1}
3333
34+ # Enable Traefik
35+ if [ -n " $MOODLE_DOCKER_TRAEFIK " ];
36+ then
37+ dockercompose=" ${dockercompose} -f ${basedir} /traefik.yml"
38+ fi
39+
3440# Database flavour
3541if [ " $MOODLE_DOCKER_DB " != ' pgsql' ];
3642then
@@ -69,7 +75,7 @@ export MOODLE_DOCKER_WEB_HOST=${MOODLE_DOCKER_WEB_HOST:-localhost}
6975
7076# Webserver port
7177export MOODLE_DOCKER_WEB_PORT=${MOODLE_DOCKER_WEB_PORT:- 8000}
72- if [[ $MOODLE_DOCKER_WEB_PORT -gt 0 ]]
78+ if [[ $MOODLE_DOCKER_WEB_PORT -gt 0 ]] && [ -z " $MOODLE_DOCKER_TRAEFIK " ]
7379then
7480 dockercompose=" ${dockercompose} -f ${basedir} /webserver.port.yml"
7581fi
Original file line number Diff line number Diff line change 1919}
2020$ CFG ->wwwroot = "http:// {$ host }" ;
2121$ port = getenv ('MOODLE_DOCKER_WEB_PORT ' );
22- if (!empty ($ port )) {
22+ if (!empty ($ port ) && empty ( getenv ( ' MOODLE_DOCKER_TRAEFIK ' )) ) {
2323 $ CFG ->wwwroot .= ": {$ port }" ;
2424}
2525$ CFG ->dataroot = '/var/www/moodledata ' ;
Original file line number Diff line number Diff line change 1+ version : " 2"
2+ services :
3+ webserver :
4+ environment :
5+ MOODLE_DOCKER_TRAEFIK : " ${MOODLE_DOCKER_TRAEFIK}"
6+ labels :
7+ - " traefik.enable=true"
8+ - " traefik.frontend.rule=Host:${MOODLE_DOCKER_WEB_HOST}"
9+ - ' traefik.docker.network=traefik_default'
10+ networks :
11+ - default
12+ - traefik
13+ exttests :
14+ networks :
15+ - default
16+ - traefik
17+ selenium :
18+ networks :
19+ - default
20+ - traefik
21+
22+ networks :
23+ default :
24+ traefik :
25+ external :
26+ name : traefik_default
You can’t perform that action at this time.
0 commit comments