This project deploys the Moodle (Modular Object-Oriented Dynamic Learning Environment) course management system using one Docker container that runs both Nginx and PHP/PHP-FPM services
-
Install Docker on your system.
./setup.sh
-
Copy/clone dockerfiles from the
moodle-docker
repository and build the containers. Note:docker-postgres
is a Git submodule inmoodle-docker
.# Moodle repo git clone https://github.com/SecurityCompass/moodle-docker.git # Pull submodules into local repo git submodule update --init
-
Copy your SSL certificate and key into the
conf/etc/nginx/ssl/
dir asmoodle.crt
andmoodle.key
. The included pair are self-signed and can be used (TESTING ONLY).Instructions below to generate your own self-signed certificate pair.
-
Customize
.env
according to your environment. Most notablyMOODLE_WWWROOT
(based on your instance IP/FQDN) -
Build, configure and start the docker containers with docker-compose.
--detach
toggles foreground/background
Here are some ways to run these containers:
cd moodle-docker docker-compose --file docker-compose.yml --file dc.build.yml build --no-cache
Modify these lines in
.env
to match your local environmentMOODLE_WWWROOT
(Usually 127.0.0.1)MOODLE_DATAROOT
(Make this directory locally and use the full path)
Then start the containers with:
cd moodle-docker docker-compose --file docker-compose.yml up --force-recreate --always-recreate-deps --detach
Modify these lines in
.env
to match your local environmentMOODLE_WWWROOT
(Usually the FQDN)MOODLE_DATAROOT
(Make this directory and use the full path)
Then start the containers with:
cd moodle-docker docker-compose --file docker-compose.yml up --force-recreate --always-recreate-deps --detach
cd moodle-docker docker-compose --file docker-compose.yml --file dc.prod-dbonly.yml up --force-recreate --detach postgres docker-compose --file docker-compose.yml up --force-recreate --no-deps --detach nginx-php-moodle
-
Generate self-signed certificate (TESTING ONLY)
openssl req -x509 -newkey rsa:4096 -keyout moodle.key -out moodle.crt -days 365 -nodes -subj "/C=CA/ST=ON/L=Toronto/O=SC/OU=Org/CN=www.example.com"