Moodle (and this Docker Recipe) is distributed under the GPL v3 license. Full details of the license can be found in the Moodle Docs.
20240930:
oeru/moodle:php83-fpm oeru/moodle-cron:php83-fpm
20240929:
oeru/moodle:php81-fpm oeru/moodle-cron:php81-fpm
20240501:
oeru/moodle:php82-fpm oeru/moodle-cron:php82-fpm
20230501:
oeru/moodle:php80-fpm oeru/moodle-cron:php80-fpm
These instructions might be useful to some, so I'm leaving them here, but I've written more comprehensive instructions on https://tech.oeru.org/installing-moodle-php7-fpm-docker-nginx-and-mariadb-ubuntu-1604
-
you need a Docker host configured to use both a current Docker and Docker Compose with network access and git installed.
-
make sure you have a MySQL or MariaDB running either on your Docker host, or in a container
-
clone this repo:
git clone [email protected]:oeru/docker-moodle.git
which will, by default, create a directory called 'docker-moodle' -
create a local docker-compose.yml by copying docker-compose.yml-sample:
cd docker-moodle
cp docker-compose.yml-sample docker-compose.yml
and the edit the file to specify the details of your MySQL or MariaDB database. You need to specify a user who has the ability to create a database. Also, if you're running an nginx container, you can tweak the ports assignments to make it publicly visible (I encourage defaulting to SSL!). -
adjust the nginx "default.conf" (replace it with "ssl.conf" if you want to offer secure hosting!) and set up the path to your repo in the yml file so that the nginx container can find the conf file.
-
you also need to create a directory on your Docker host for your Moodle code, and reference it in the yml file.
-
then run
docker-compose up
to pull (if necessary) and run your moodle (and, if you're using it) your nginx container. If you're running it locally, access it viahttp://localhost:8083
in a browser. -
Run
docker-compose up
, wait for it to initialize completely, and visithttp://localhost:8080
orhttp://host-ip:8080
.
If you're running MySQL or MariaDB in another container, add another stanza to this yml file to describe it and link it with the moodle stanza!
moodle:
image: oeru/moodle
links:
- moodledb:mysql
ports:
- ...
moodledb:
image: mariadb
This has been tested on Docker 1.13.1 on Ubuntu Linux 16.04 and requires Docker 1.10.x or better.
-
need to configure local MySQL or MariaDB to bind to 0.0.0.0 rather than 127.0.0.1
-
need to make configuration changes to DB - for mariadb, edit
/etc/mysql/mariadb.conf.d/50-server.cnf
and add under `[mysqld] the following lines:
innodb_file_format = Barracuda innodb_file_per_table = 1 innodb_large_prefix character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci skip-character-set-client-handshake
- if you're using SSL (like Let's Encrypt) make sure that your moodle/src/config.php includes the line
$CFG->sslproxy=true;
If you have any problems with or questions about this image, please contact us through a GitHub issue. We will endeavour to assist, although we're doing this through enlightened self-interest, so can't provide any guarantees!