Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: moodlehq/moodle-docker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fc7d87c2699e3334994398c96fea11ae44ce4fec
Choose a base ref
..
head repository: moodlehq/moodle-docker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4675228b79c6290ba673c271996161684a680ead
Choose a head ref
Showing with 119 additions and 24 deletions.
  1. +16 −6 .github/workflows/ci.yml
  2. +1 −0 .gitignore
  3. +28 −2 README.md
  4. +2 −0 bbb-mock.yml
  5. +19 −1 bin/moodle-docker-compose
  6. +27 −1 bin/moodle-docker-compose.cmd
  7. +1 −0 db.mariadb.yml
  8. +1 −1 db.mssql.yml
  9. +10 −0 db.mysql.5.6.yml
  10. +10 −0 db.mysql.5.7.yml
  11. +0 −7 db.mysql.8.0.yml
  12. +2 −4 db.mysql.yml
  13. +1 −1 db.pgsql.yml
  14. +1 −1 moodle-app-dev-ionic5.yml
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@ jobs:
matrix:
include:
# PostgreSQL (highest, lowest php supported)
- { branch: master, php: "8.0", database: pgsql, suite: phpunit-full } # Full run only for master.
- { branch: master, php: "7.4", database: pgsql, suite: phpunit-full }
#- { branch: master, php: "8.1", database: pgsql, suite: phpunit-full } # Full run only for master.
- { branch: master, php: "8.0", database: pgsql, suite: phpunit-full }
- { branch: MOODLE_401_STABLE, php: "8.0", database: pgsql, suite: phpunit } # Other branches, quicker run.
- { branch: MOODLE_401_STABLE, php: "7.4", database: pgsql, suite: phpunit }
- { branch: MOODLE_400_STABLE, php: "8.0", database: pgsql, suite: phpunit }
@@ -24,7 +24,7 @@ jobs:
- { branch: MOODLE_39_STABLE, php: "7.4", database: pgsql, suite: phpunit }
- { branch: MOODLE_39_STABLE, php: "7.2", database: pgsql, suite: phpunit }
# MariaDB (lowest php supported)
- { branch: master, php: "7.4", database: mariadb, suite: phpunit }
- { branch: master, php: "8.0", database: mariadb, suite: phpunit }
- { branch: MOODLE_401_STABLE, php: "7.4", database: mariadb, suite: phpunit }
- { branch: MOODLE_400_STABLE, php: "7.3", database: mariadb, suite: phpunit }
- { branch: MOODLE_311_STABLE, php: "7.3", database: mariadb, suite: phpunit }
@@ -89,8 +89,10 @@ jobs:
matrix:
include:
# PostgreSQL (highest, lowest php supported)
- { branch: master, php: "8.0", database: pgsql, browser: chrome, suite: behat }
- { branch: master, php: "7.4", database: pgsql, browser: firefox, suite: behat }
#- { branch: master, php: "8.1", database: pgsql, browser: chrome, suite: behat }
- { branch: master, php: "8.0", database: pgsql, browser: firefox, suite: behat }
- { branch: MOODLE_401_STABLE, php: "8.0", database: pgsql, browser: chrome, suite: behat }
- { branch: MOODLE_401_STABLE, php: "7.4", database: pgsql, browser: firefox, suite: behat }
- { branch: MOODLE_400_STABLE, php: "8.0", database: pgsql, browser: chrome, suite: behat }
- { branch: MOODLE_400_STABLE, php: "7.3", database: pgsql, browser: firefox, suite: behat }
- { branch: MOODLE_311_STABLE, php: "8.0", database: pgsql, browser: chrome, suite: behat }
@@ -100,23 +102,27 @@ jobs:
- { branch: MOODLE_39_STABLE, php: "7.4", database: pgsql, browser: chrome, suite: behat }
- { branch: MOODLE_39_STABLE, php: "7.2", database: pgsql, browser: firefox, suite: behat }
# MariaDB (lowest php supported)
- { branch: master, php: "7.4", database: mariadb, browser: chrome, suite: behat }
- { branch: master, php: "8.0", database: mariadb, browser: chrome, suite: behat }
- { branch: MOODLE_401_STABLE, php: "7.4", database: mariadb, browser: firefox, suite: behat }
- { branch: MOODLE_400_STABLE, php: "7.3", database: mariadb, browser: firefox, suite: behat }
- { branch: MOODLE_311_STABLE, php: "7.3", database: mariadb, browser: firefox, suite: behat }
- { branch: MOODLE_310_STABLE, php: "7.2", database: mariadb, browser: chrome, suite: behat }
- { branch: MOODLE_39_STABLE, php: "7.2", database: mariadb, browser: firefox, suite: behat }
# Other databases (highest php supported")
- { branch: master, php: "8.0", database: mssql, browser: chrome, suite: behat }
- { branch: MOODLE_401_STABLE, php: "8.0", database: mssql, browser: firefox, suite: behat }
- { branch: MOODLE_400_STABLE, php: "8.0", database: mssql, browser: firefox, suite: behat }
- { branch: MOODLE_311_STABLE, php: "8.0", database: mssql, browser: firefox, suite: behat }
- { branch: MOODLE_310_STABLE, php: "7.4", database: mssql, browser: chrome, suite: behat }
- { branch: MOODLE_39_STABLE, php: "7.4", database: mssql, browser: firefox, suite: behat }
- { branch: master, php: "8.0", database: mysql, browser: chrome, suite: behat }
- { branch: MOODLE_401_STABLE, php: "8.0", database: mysql, browser: firefox, suite: behat }
- { branch: MOODLE_400_STABLE, php: "8.0", database: mysql, browser: firefox, suite: behat }
- { branch: MOODLE_311_STABLE, php: "8.0", database: mysql, browser: firefox, suite: behat }
- { branch: MOODLE_310_STABLE, php: "7.4", database: mysql, browser: chrome, suite: behat }
- { branch: MOODLE_39_STABLE, php: "7.4", database: mysql, browser: firefox, suite: behat }
- { branch: master, php: "8.0", database: oracle, browser: chrome, suite: behat }
- { branch: MOODLE_401_STABLE, php: "8.0", database: oracle, browser: firefox, suite: behat }
- { branch: MOODLE_400_STABLE, php: "8.0", database: oracle, browser: firefox, suite: behat }
- { branch: MOODLE_311_STABLE, php: "8.0", database: oracle, browser: firefox, suite: behat }
- { branch: MOODLE_310_STABLE, php: "7.4", database: oracle, browser: chrome, suite: behat }
@@ -167,6 +173,10 @@ jobs:
- { branch: MOODLE_311_STABLE, php: "8.0", database: pgsql, runtime: ionic3, suite: app, app-version: "3.9.0"}
- { branch: MOODLE_311_STABLE, php: "7.3", database: pgsql, runtime: ionic3, suite: app, app-version: "3.9.0"}

- { branch: MOODLE_401_STABLE, php: "8.0", database: pgsql, runtime: ionic5, suite: app-development, app-version: "4.0.0"}
- { branch: MOODLE_401_STABLE, php: "7.4", database: pgsql, runtime: ionic5, suite: app-development, app-version: "4.0.0"}
- { branch: MOODLE_401_STABLE, php: "8.0", database: pgsql, runtime: ionic5, suite: app, app-version: "4.0.0-dev"}
- { branch: MOODLE_401_STABLE, php: "7.4", database: pgsql, runtime: ionic5, suite: app, app-version: "4.0.0-dev"}
- { branch: MOODLE_400_STABLE, php: "8.0", database: pgsql, runtime: ionic5, suite: app-development, app-version: "4.0.0"}
- { branch: MOODLE_400_STABLE, php: "7.3", database: pgsql, runtime: ionic5, suite: app-development, app-version: "4.0.0"}
- { branch: MOODLE_400_STABLE, php: "8.0", database: pgsql, runtime: ionic5, suite: app, app-version: "4.0.0-dev"}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local.yml
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -206,8 +206,8 @@ When you change them, use `bin/moodle-docker-compose down && bin/moodle-docker-c
|-------------------------------------------|-----------|---------------------------------------|---------------|------------------------------------------------------------------------------|
| `MOODLE_DOCKER_DB` | yes | pgsql, mariadb, mysql, mssql, oracle | none | The database server to run against |
| `MOODLE_DOCKER_WWWROOT` | yes | path on your file system | none | The path to the Moodle codebase you intend to test |
| `MOODLE_DOCKER_DB_VERSION` | no | Docker tag - see relevant database page on docker-hub | mysql: 5.7 <br/>pgsql: 12 <br/>mariadb: 10.7 <br/>mssql: 2017-latest <br/>oracle: 21| The database server docker image tag |
| `MOODLE_DOCKER_PHP_VERSION` | no | 8.0, 7.4, 7.3, 7.2, 7.1, 7.0, 5.6 | 7.4 | The php version to use |
| `MOODLE_DOCKER_DB_VERSION` | no | Docker tag - see relevant database page on docker-hub | mysql: 8.0 <br/>pgsql: 13 <br/>mariadb: 10.7 <br/>mssql: 2017-latest <br/>oracle: 21| The database server docker image tag |
| `MOODLE_DOCKER_PHP_VERSION` | no | 8.1, 8.0, 7.4, 7.3, 7.2, 7.1, 7.0, 5.6 | 8.0 | The php version to use |
| `MOODLE_DOCKER_BROWSER` | no | firefox, chrome, firefox:&lt;tag&gt;, chrome:&lt;tag&gt; | firefox:3 | The browser to run Behat against. Supports a colon notation to specify a specific Selenium docker image version to use. e.g. firefox:2.53.1 can be used to run with older versions of Moodle (<3.5) |
| `MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES` | no | any value | not set | If set, dependencies for memcached, redis, solr, and openldap are added |
| `MOODLE_DOCKER_BBB_MOCK` | no | any value | not set | If set the BigBlueButton mock image is started and configured |
@@ -219,6 +219,32 @@ When you change them, use `bin/moodle-docker-compose down && bin/moodle-docker-c
| `MOODLE_DOCKER_APP_PATH` | no | path on your file system | not set | If set and the chrome browser is selected, it will start an instance of the Moodle app from your local codebase |
| `MOODLE_DOCKER_APP_VERSION` | no | a valid [app docker image version](https://docs.moodle.org/dev/Moodle_App_Docker_images) | not set | If set will start an instance of the Moodle app if the chrome browser is selected |
| `MOODLE_DOCKER_APP_RUNTIME` | no | 'ionic3' or 'ionic5' | not set | Set this to indicate the runtime being used in the Moodle app. In most cases, this can be ignored because the runtime is guessed automatically (except on Windows using the `.cmd` binary). In case you need to set it manually and you're not sure which one it is, versions 3.9.5 and later should be using Ionic 5. |
| `MOODLE_DOCKER_APP_NODE_VERSION` | no | [node](https://hub.docker.com/_/node) image version tag | not set | Node version to run the app. In most cases, this can be ignored because the version is parsed from the project's `.nvmrc` file. This will only be used when the runtime is `ionic5` and the app is running from the local filesystem. |

## Local customisations

In some situations you may wish to add local customisations, such as including additional containers, or changing existing containers.

This can be accomplished by specifying a `local.yml`, which will be added in and loaded with the existing yml configuration files automatically. For example:

``` file="local.yml"
version: "2"
services:
# Add the adminer image at the latest tag on port 8080:8080
adminer:
image: adminer:latest
restart: always
ports:
- 8080:8080
depends_on:
- "db"
# Modify the webserver image to add another volume:
webserver:
volumes:
- "/opt/data:/opt/data:cached"
```

## Using XDebug for live debugging

2 changes: 2 additions & 0 deletions bbb-mock.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version: "2"
services:
webserver:
MOODLE_DOCKER_BBB_MOCK: "true"
bbbmock:
image: moodlehq/bigbluebutton_mock
20 changes: 19 additions & 1 deletion bin/moodle-docker-compose
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ dockercompose="${dockercompose} -f ${basedir}/base.yml"
dockercompose="${dockercompose} -f ${basedir}/service.mail.yml"

# PHP Version.
export MOODLE_DOCKER_PHP_VERSION=${MOODLE_DOCKER_PHP_VERSION:-7.4}
export MOODLE_DOCKER_PHP_VERSION=${MOODLE_DOCKER_PHP_VERSION:-8.0}

# Database flavour.
dockercompose="${dockercompose} -f ${basedir}/db.${MOODLE_DOCKER_DB}.yml"
@@ -112,6 +112,16 @@ then
fi
fi

# Guess mobile app node version
if [[ -z "$MOODLE_DOCKER_APP_NODE_VERSION" ]] && [[ ! -z "$MOODLE_DOCKER_APP_PATH" ]] && [[ "$MOODLE_DOCKER_APP_RUNTIME" == "ionic5" ]];
then
if [ -f "$MOODLE_DOCKER_APP_PATH/.nvmrc" ]; then
appnodeversion="$(cat $MOODLE_DOCKER_APP_PATH/.nvmrc | grep -oP '(\d+\.?)+' || true)"

export MOODLE_DOCKER_APP_NODE_VERSION="$appnodeversion"
fi
fi

# Mobile app for development
if [[ ! -z "$MOODLE_DOCKER_BROWSER" ]] && [[ "$MOODLE_DOCKER_BROWSER" == "chrome" ]] && [[ ! -z "$MOODLE_DOCKER_APP_PATH" ]];
then
@@ -207,5 +217,13 @@ if [[ "$(uname)" == "Darwin" ]]; then
dockercompose="${dockercompose} -f ${basedir}/volumes-cached.yml"
fi

# Apply local customisations if a local.yml is found.
# Note: This must be the final modification before the docker-compose command is called.
localfile="${basedir}/local.yml"
if [ -f "${localfile}" ]
then
echo "Including local options from ${localfile}"
dockercompose="${dockercompose} -f ${localfile}"
fi

$dockercompose "$@"
28 changes: 27 additions & 1 deletion bin/moodle-docker-compose.cmd
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ SET DOCKERCOMPOSE=docker-compose -f "%BASEDIR%\base.yml"
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%BASEDIR%\service.mail.yml"

IF "%MOODLE_DOCKER_PHP_VERSION%"=="" (
SET MOODLE_DOCKER_PHP_VERSION=7.4
SET MOODLE_DOCKER_PHP_VERSION=8.0
)

SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%BASEDIR%\db.%MOODLE_DOCKER_DB%.yml"
@@ -64,6 +64,23 @@ IF "%MOODLE_DOCKER_APP_RUNTIME%"=="" (
SET MOODLE_DOCKER_APP_RUNTIME=ionic5
)

REM Guess mobile app node version
IF "%MOODLE_DOCKER_APP_NODE_VERSION%"=="" (
IF NOT "%MOODLE_DOCKER_APP_PATH%"=="" (
IF "%MOODLE_DOCKER_APP_RUNTIME%"=="ionic5" (
SET filenvmrc=%MOODLE_DOCKER_APP_PATH%\.nvmrc
IF EXIST "%filenvmrc%" (
SET /p NODE_VERSION=< "%filenvmrc%"
SET NODE_VERSION=%NODE_VERSION:v=%
ECHO %NODE_VERSION% | FINDSTR /r "[0-9.]*" >nul 2>&1
IF ERRORLEVEL 0 (
SET MOODLE_DOCKER_APP_NODE_VERSION=%NODE_VERSION%
)
)
)
)
)

IF "%MOODLE_DOCKER_BROWSER%"=="chrome" (
IF NOT "%MOODLE_DOCKER_APP_PATH%"=="" (
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%BASEDIR%\moodle-app-dev-%MOODLE_DOCKER_APP_RUNTIME%.yml"
@@ -148,4 +165,13 @@ IF "%MOODLE_DOCKER_SELENIUM_VNC_PORT%"=="" (
)
)


REM Apply local customisations if a local.yml is found.
REM Note: This must be the final modification before the docker-compose command is called.
SET LOCALFILE=%BASEDIR%\local.yml
IF EXIST %LOCALFILE% (
ECHO Including local options from %localfile%
SET DOCKERCOMPOSE=%DOCKERCOMPOSE% -f "%LOCALFILE%"
)

%DOCKERCOMPOSE% %*
1 change: 1 addition & 0 deletions db.mariadb.yml
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ services:
--collation-server=utf8mb4_bin
--innodb_file_per_table=On
--wait-timeout=28800
--skip-log-bin
environment:
MYSQL_ROOT_PASSWORD: "m@0dl3ing"
MYSQL_USER: moodle
2 changes: 1 addition & 1 deletion db.mssql.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ services:
MOODLE_DOCKER_DBTYPE: sqlsrv
MOODLE_DOCKER_DBUSER: sa
db:
image: moodlehq/moodle-db-mssql:${MOODLE_DOCKER_DB_VERSION:-2017-latest}
image: moodlehq/moodle-db-mssql:${MOODLE_DOCKER_DB_VERSION:-latest}
environment:
ACCEPT_EULA: "y"
SA_PASSWORD: "m@0dl3ing"
10 changes: 10 additions & 0 deletions db.mysql.5.6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "2"
services:
db:
image: mysql:${MOODLE_DOCKER_DB_VERSION:-5.6}
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_bin
--innodb_file_format=barracuda
--innodb_file_per_table=On
--innodb_large_prefix=On
10 changes: 10 additions & 0 deletions db.mysql.5.7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "2"
services:
db:
image: mysql:${MOODLE_DOCKER_DB_VERSION:-5.7}
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_bin
--innodb_file_format=barracuda
--innodb_file_per_table=On
--innodb_large_prefix=On
7 changes: 0 additions & 7 deletions db.mysql.8.0.yml

This file was deleted.

6 changes: 2 additions & 4 deletions db.mysql.yml
Original file line number Diff line number Diff line change
@@ -5,13 +5,11 @@ services:
MOODLE_DOCKER_DBTYPE: mysqli
MOODLE_DOCKER_DBCOLLATION: utf8mb4_bin
db:
image: mysql:${MOODLE_DOCKER_DB_VERSION:-5.7}
image: mysql:${MOODLE_DOCKER_DB_VERSION:-8.0}
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_bin
--innodb_file_format=barracuda
--innodb_file_per_table=On
--innodb_large_prefix=On
--skip-log-bin
environment:
MYSQL_ROOT_PASSWORD: "m@0dl3ing"
MYSQL_USER: moodle
2 changes: 1 addition & 1 deletion db.pgsql.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ services:
environment:
MOODLE_DOCKER_DBTYPE: pgsql
db:
image: postgres:${MOODLE_DOCKER_DB_VERSION:-12}
image: postgres:${MOODLE_DOCKER_DB_VERSION:-13}
environment:
POSTGRES_USER: moodle
POSTGRES_PASSWORD: "m@0dl3ing"
2 changes: 1 addition & 1 deletion moodle-app-dev-ionic5.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ services:
environment:
MOODLE_DOCKER_APP: "true"
moodleapp:
image: node:14
image: node:${MOODLE_DOCKER_APP_NODE_VERSION:-14}
working_dir: /app
command: npm start -- --host 0.0.0.0
volumes: