Planning a Docker-based production-grade deployment of Moodle

Planning a Docker-based production-grade deployment of Moodle

by Christian Stankowic -
Number of replies: 4

Hi community,

I'm currently planning a Docker-based deployment for Moodle. It should be production-grade, the installation will consist of multiple hundred Moodle environments having ~100 users each.

I saw that there are multiple container images available on Docker Hub - but the only official one seems to focus on development only: https://hub.docker.com/r/moodlehq/moodle-php-apache

The image uses Apache + PHP - for performance reasons I'd like to use an alternative setup based on NGINX. I also had a look at the installation guide for recommendations regarding Docker - but found nothing.


My question is - does anybody have experiences with running dozens of Moodle installations on Docker? From a performance perspective, what would you recommend?


Best wishes and thanks a lot in advance,

Christian.

Average of ratings: -
In reply to Christian Stankowic

Re: Planning a Docker-based production-grade deployment of Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Caveat - I am not a Docker convert. I've never been in a situation were I've thought "Docker is the answer". This, of course, means that I probably don't understand it properly. However..

My understanding is that Docker packages up all your requirements in one nice "box". So all your database, web server, and all the other stuff is defined. Which is great. But I can't see why this is a good thing for a multiple Moodle site. The underlying requirements are fixed in stone (pretty much). You have a database, a web server, all the other dependencies. To have multiple versions of these things (all the same version) is surely a waste? Containers, like VMs, don't magically create underlying resources.

So... personally, I would do this the old-fashioned way and use Bash scripts to automate creation, deletion and upgrading (which always seems to be the hard bit with Docker). Git and Moosh will smooth the process.

Just my $00.02
Average of ratings: Useful (3)
In reply to Howard Miller

Re: Planning a Docker-based production-grade deployment of Moodle

by Christian Stankowic -
Hi Howard,
thanks for the feedback!

One of the use-cases would be having everything in a nice box that can be duplicated easily - and this would lead into a lot of duplicated database instances, you're right. My idea is to have a smaller container that only contains the Moodle application. I'd like to move the database to a dedicated MariaDB cluster that has enough power meet all the parallel access requirements (in terms of performance). As Docker containers are basically stateless and loose all their changed data (in comparison with the image you were using) once you stopped them, there won't be a big duplication on data-level. Only individual data per Moodle installation (e.g. configuration, uploaded content, etc.) will be stored in a persistent way - the rest of the data is simply used from the base image.

Also thanks for mentioning moosh - I've never heard about that plugin, looks pretty useful!

Best wishes,
Christian.
Average of ratings: Useful (1)
In reply to Christian Stankowic

Re: Planning a Docker-based production-grade deployment of Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators

Recently there ware a couple of discussions:

Average of ratings: Useful (3)
In reply to Visvanath Ratnaweera

Re: Planning a Docker-based production-grade deployment of Moodle

by Christian Stankowic -
Hi Visvanath,

thanks for sharing the links - that looks very interesting. Will try the supplied code. smile

Best wishes,
Christian.