This repository is for setting up Moodle via Docker Compose. This configuration is intended for spinning up an instance of the web app for testing purposes.
A Moodle application consists of three parts:
Moodle Core -- what you see at https://github.com/moodle/moodle
A Moodle Database -- this is a database (Mysql, in this case) which the Moodle application populates automatically. It contains site themes and settings.
Moodledata -- This is a Moodle term and means uploaded site content (i.e, course material).
Similar to a virtual machine, Docker is used as a means of isolating application parts for development. The commands for setting up the Docker environment/image are included in a file called Dockerfile. Docker images are portable and are thus used in development, testing, and production. An image can either be created by "building" off of a Dockerfile or by pulling an existing Docker image from a Docker Image Repository such as DockerHub. This repo contains the Dockerfile that I used to build the image on Dockerhub.
Docker Compose is a tool for linking multiple Docker containers (instances of Docker images). For example, in this repo, the web application, web server, and libraries are set up in a container called "moodle" and the database runs in a separate "mysql" database. The containers are linked together in the docker-compose.yml file. Since Docker containers are ephemeral, Docker provides a system for persisting data via data volumes. The volume in this case is specified at the end of the docker-compose.yml file.
You can spin up this project on your local pc or on a cloud provider. The configuration for a pc and cloud service varies slightly. The master branch of this repository will work for setting up the project on your pc.
The instructions below cover setup on a pc and a public IP address. If serving publicly, be sure you are logged in to the server before you start.
git clone https://[email protected]/eeg1/complete-moodle-setup-with-docker-compose-pc.gitcd complete-moodle-setup-with-docker-compose-pc/./public_ip.sh This will run a script that changes the Moodle IP address from "localhost" to that of your public IP addressdocker-compose upContent type
Image
Digest
Size
289.3 MB
Last updated
about 9 years ago
docker pull elaskin/moodle