Set up the database according to https://docs.moodle.org/31/en/PostgreSQL
Moodle automatically checks for upgrades and informs users of available upgrades on the website.
To upgrade:
ubuntu@dokku6:~$ sudo tar -czf moodle_files_2017-01-24.tgz /var/moodlerobin:~$ scp [email protected]:moodle_files_2017-01-24.tgz .pg_dump "postgres://moodle:[email protected]/moodle" -O -c --if-exists|gzip > prod_2017-01-24.sql.gzubuntu@dokku6:~$ docker pull code4sa/moodle-base:latestubuntu@dokku6:~$ dokku ps:rebuild moodleThis image is usually built by docker hub and pulled by the dokku host. You don't usually need to build it yourself.
docker build -t code4sa/moodle-base:latest -f Dockerfile-base .
docker build -t code4sa/moodle-dokku:latest -f Dockerfile --build-arg NEWRELIC_KEY=... .
docker run -i --net=host -v `pwd`/moodledata:/var/moodledata --name=moodle code4s/moodle-dokku:latest
docker start -i moodle
Visit it at http://localhost/
Moodle is deployed to dokku using "Dockerfile deployment". As usual, we push this repository to dokku. Dokku will see the Dockerfile and build it to create the app image and start the container as usual. This Dockerfile depends on a base image code4sa/moodle-base which we usually build on Docker Hub.
Add remote to your local repo
git remote add dokku [email protected]:moodle
Configure environment variables and options on server, replacing ... with appropriate values
dokku config:set moodle \
DB_HOST=postgresql94-prod.cnc362bhpvfe.eu-west-1.rds.amazonaws.com \
DB_NAME=moodle \
DB_USER=moodle \
DB_PASSWORD=... \
MOODLE_URL=https://learn.code4sa.org
dokku docker-options:add moodle build,run,deploy "-v /var/log/moodle/apache2:/var/log/apache2"
dokku docker-options:add moodle build,run,deploy "-v /var/moodle/:/var/moodledata"
dokku docker-options:add moodle build "--build-arg NEWRELIC_KEY=..."
dokku proxy:ports-add moodle http:80:80
If the base image has been updated, ensure the latest image is on the host
ubuntu@dokku6:~$ docker pull code4sa/moodle-base:latest
Push any config/dockerfile updates to dokku. Dokku will build an image based on Dockerfile.
git push dokku master
*/1 * * * * dokku --rm run moodle /usr/bin/php /var/www/html/admin/cli/cron.php > /dev/null
Content type
Image
Digest
Size
239.7 MB
Last updated
over 9 years ago
docker pull code4sa/moodle-base