General developer forum

Worskpace for Moodle using Docker Compose

 
Picture of Job Cespedes
Worskpace for Moodle using Docker Compose
 

Hello,

Here there is a project to easily run a local Moodle workspace using Docker Compose. It is called docker-compose-moodle It builds several containers for each Moodle main platform components (Apache2, PHP-FPM with XDEBUG and Postgres). The idea is to quickly build and easily manage a local development workspace using Docker Compose.

Greetings,

 
Average of ratings: -
Picture of Fernando Acedo
Re: Worskpace for Moodle using Docker Compose
Group Particularly helpful MoodlersGroup Plugin developersGroup Testers

Muchas gracias. Good job.

Would be possible a container using MySQL instead Postgres?

 
Average of ratings: -
Picture of Job Cespedes
Re: Worskpace for Moodle using Docker Compose
 

Yes, I think it is. It might be just a matter of defining the container and changing 'dbtype' in config.php.

 
Average of ratings: -
Picture of Rex Lorenzo
Re: Worskpace for Moodle using Docker Compose
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developersGroup Plugins guardiansGroup Testers

Very cool. I am also interested in containers and Moodle. Have you looked into Kubernetes as well?

Would these containers be something you can deploy into a production environment?

 
Average of ratings: -
Picture of Job Cespedes
Re: Worskpace for Moodle using Docker Compose
 
The project has never been tested in a production environment. It's meant for local development. Although, it follows Moodle docs and some Moodleadmin experience. Moodlewise could be part of the basis, but Containerwise I'm not sure.
 
I've heard about Kubernetes, but have no experience yet. One thing I've been trying to figure out is what to do with shared storage (moodledata) and code syncronization (moodle php code) if you deploy a dockerized Moodle across several hosts (besides NFS).
 
Average of ratings: -
Picture of Matteo Scaramuccia
Re: Worskpace for Moodle using Docker Compose
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Hi Rex,
what proposed here is based on docker compose i.e. to be run on a plain docker host or on a docker in swarm mode; you should also try it by means of OpenShift which is based on docker and kubernetes or just using kompose to properly translate the proposed multi-container deployment into a kubernetes resources manifest:

Beware on the compose file version: now is v3, compared to v2 (and v1) now supported by kompose.

For a production deployment there are at least some missing points here like e.g. named volumes for best shared storage maybe using a different volume driver and the possibility to safely update each container (OS updates, App patches, ...) which is IMHO the key point when moving containers into production since usually the maintenance is done by updating the related container image in the well crafted hierarchy of your production-ready images - probably, using a private registry to best keep your own baseline - and not the running container, as done in a "normal" deployment (last resort for sure).
This means also the ability to manage what is stateful in the production environment e.g. the DB server and almost certainly its high availability.

I'm interested too in a working containerized production environment for Moodle, potentially multi-tenant wink.

HTH,
Matteo

 
Average of ratings: Useful (1)
Picture of Matteo Scaramuccia
Re: Worskpace for Moodle using Docker Compose
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Hi Everyone,
just a quick share about Docker files (w/o compose): keep an eye on https://github.com/CentOS/CentOS-Dockerfiles since it is creating a set of images able to run even within Openshift.
Oddly, today a Moodle image PR has been filed: https://github.com/CentOS/CentOS-Dockerfiles/pull/130.

It's far from being composed - in terms of multiple services for an "advanced" Moodle instance and even in terms of (re)creating different environments for dev/tests purposes - but it's pretty nice for being Openshift ready and for (trying to?) adding Moodle there.

HTH,
Matteo

 
Average of ratings: Useful (1)
Picture of Zeeshan Ahmed
Re: Worskpace for Moodle using Docker Compose
 

To add to this, if a container is functional on openshift, then in very high likely hood work on kubernetes as well with little to no change.

 
Average of ratings: -
Picture of Zeeshan Ahmed
Re: Worskpace for Moodle using Docker Compose
 

CentOS based openshift ready moodle container now available as registry.centos.org/centos/moodle:3.1

https://wiki.centos.org/ContainerPipeline


Please do try it out and provide feedback if any.

 
Average of ratings: Useful (1)
Picture of Dashamir Hoxha
Re: Worskpace for Moodle using Docker Compose
 

Here is a containerized Moodle that I use in production: https://github.com/docker-scripts/moodle

(However I have to admit that my "production" does not have yet any heavy loads.)

 
Average of ratings: -