Docker scripts that install and run Moodle in a container.
Then get the moodle scripts from github:
ds pull moodle
Create a directory for the moodle container:
ds init moodle @moodle1-example-org
Fix the settings:
cd /var/ds/moodle1-example-org/; vim settings.sh
Create the container and install Moodle:
Note: This will pull the image from DockerHub. To build the image yourself use
ds buildfirst, however this is usually slower.
Access the website
If the domain is a real one, tell
wsproxy to get a free
letsencrypt.org SSL certificate for it:
ds wsproxy ssl-cert --test ds wsproxy ssl-cert
If the domain is not a real one, add to
/etc/hosts the line
Now you can access the website at: https://moodle1.example.org
ds shell ds stop ds start ds help
Backup and restore
ds backup ds backup +data ds restore backup-file.tgz
ds clone tag ds clone-del tag
Cloning will create a new installation inside the same container. It
dbname_tag, etc. and make sure that
the new installation can be accessed on
Update and upgrade
To update the current stable branch (for example from 3.3.1 to 3.3.2)
ds update. This is done quite frequently and usually has no
risks of breaking anything.
To upgrade to the next stable branch (for example from 3.2 to 3.3) use
ds upgrade moodle MOODLE_33_STABLE. It will try to upgrade the
additional plugins as well, if they have a version that matches the
latest moodle release. However this does not always work and some
plugins may need to be fixed manually.
Since the upgrade process may be faced with some problems to be solved, it is better to try it first on a test site, and after making sure that everything works correctly, apply it to the real site. This can be done like this:
ds clone test ds upgrade moodle_test MOODLE_33_STABLE # make sure that everything works and fix any problems ds upgrade moodle MOODLE_33_STABLE ds clone-del test
Both update and upgrade make a backup before making any changes, just in case.
ds remake rebuilds everything from scratch, but
preserves the existing database and data files.