Sign inSign up

michaellang/moodle

By michaellang

Updated almost 9 years ago

Moodle Community Edition Docker images

Image
2

10K+

michaellang/moodle repository overview

Moodle Community Edition Docker images for Openshift

!!! This image is not meant to be Production/Operational/Mission Critical used !!! !!! Frontend can scale, backends are not expected to scale unless you deploy a clustered/sharded backend !!!

Details tag 3.3.2:

  • Image is based on CentOS 7
  • Image is using Apache 2.4 and PHP 7.0

Details tag 3.3.2-php7.1

  • Image is based on CentOS 7
  • Image is using Apache 2.4 and PHP 7.1

Howto deploy this in Openshift Online

  • create a new Project
  • select a Database of your choice (MySQL,MariaDB,PostgreSQL)
  • deploy a Database, note credentials to connect (Hostname, User, Password, Database name)
  • deploy a custom image to your Project by selecting Image Name "docker.io/michaellang/moodle:3.3.2"
  • create a route to your service
  • wait for the POD to startup
  • visit the created Route and follow the web based deployment

for all who do not want to do automatic deployments ... Specifying following Environment Variables will skip the Web based installation and get you the the finalized deployment.

Example Environment for PostgreSQL:

WWWROOT=http:// DATABASE=pgsql DATABASE_NAME=<database name, visible at Resources -> secrets -> Postgresql> DATABASE_USER=<database user, visible at Resources -> secrets -> Postgresql> DATABASE_PASSWORD=<database user, visible at Resources -> secrets -> Postgresql> DATABASE_PORT=5432 DATABASE_HOST= ADMIN_USER= ADMIN_PASS=<administrative password to login, you'll be forced to change on first login>

plain docker usage with 10G PostgreSQL and 10G Moodle file persistent storages

create persistent storage in local file system

$ mkdir /var/lib/pgsql/data /var/lib/moodledata $ lvcreate -L10G -n pgsqldata volgrp $ lvcreate -L10G -n moodledata volgrp $ mkfs.xfs /var/lib/pgsql/data $ mkfs.xfs /var/lib/moodledata $ echo "/dev/volgrp/pgsqldata /var/lib/pgsql/data xfs default 0 0" >> /etc/fstab $ echo "/dev/volgrp/moodledata /var/lib/moodledata xfs default 0 0" >> /etc/fstab $ mount -a $ chcont -t svirt_sandbox_file_t /var/lib/pgsql/data /var/lib/moodledata

start your PostgreSQL database backend and create a Database

$ docker run -d -p 5432:5432 -v /var/lib/pgsql/data:/var/lib/pgsql/data --name postgresql -e "POSTGRESQL_USER=moodle" -e "POSTGRESQL_PASSWORD=$(uuidgen | md5sum | cut -f1 -d' ')" -e "POSTGRESQL_DATABASE=moodle" docker.io/centos/postgresql-95-centos7

create an Environment file with following settings

$ cat <<EOF moodle.env

WWWROOT=http://mymoodle-dns-name:8080 DATAROOT=/opt/app-root/moodledata DATABASE=pgsql DATABASE_NAME=moodle DATABASE_USER=moodle DATABASE_PASSWORD= DATABASE_PORT=5432 DATABASE_HOST=postgresql ADMIN_USER=admin ADMIN_PASS=$(uuidgen | md5sum | cut -f1 -d' ') FULLNAME=change_me_later_if_including_spaces SHORTNAME=moodle EOF

start your moodle instance with the environment file to skip web based configuration

$ docker run -d -p 8080:8080 -v /var/lib/moodledata:/opt/app-root/moodledata --link postgresql --name moodle --env-file moodle.env michaellang/moodle:3.3.2

use follwing command if you removed the container and need to recreate it with the existing Database and existing Persistent storage

$ docker run -d -p 8080:8080 -v /var/lib/moodledata:/opt/app-root/moodledata --link postgresql --name moodle --env-file moodle.env -e "SKIP_DATABASE=--skip-database" michaellang/moodle:3.3.2

Tag summary

Content type

Image

Digest

Size

263.8 MB

Last updated

almost 9 years ago

docker pull michaellang/moodle:3.3.2-php7.1