Skip to content

Docker Development Setup

Tim Hodson edited this page Oct 3, 2019 · 4 revisions

This guide uses MoodleHQs Moodle Docker to get a simple working environment setup.

Steps:

  1. clone moodle into a local repo.
    git clone [email protected]:moodle/moodle.git
  2. clone moodle-docker repo.
    git clone [email protected]:moodlehq/moodle-docker.git
  3. clone this repo
    git clone [email protected]:talis/aspire-moodle-integration.git
  4. Go into the Moodle Docker directory and run these commands.
    cd moodle-docker
    
    # tell moodle docker to use pgsql as the db. other options are available.
    export MOODLE_DOCKER_DB=pgsql
    
    # You might prefer absolute path, but this worked.
    export MOODLE_DOCKER_WWWROOT=../moodle
    
    # copy a config template to the moodle root
    cp config.docker-template.php $MOODLE_DOCKER_WWWROOT/config.php
    
    # Bring up the containers
    bin/moodle-docker-compose up -d
    
    # this will save you having to do a gui based install when you go the the local website for moodle
    bin/moodle-docker-compose\
     exec webserver php admin/cli/install_database.php\
     --agree-license\
     --fullname="Docker moodle"\
     --shortname="docker_moodle"\
     --adminpass="test"\
     --adminemail="[email protected]"
  5. Check it works - use a browser to go to http://localhost:8000 - if you need a different port you can change that using a moodle docker environment variable.
  6. Assuming that you have a moodle site that you can log into... Now install the plugin. Easiest way is to just copy the files into the right place.
    cd $MOODLE_DOCKER_WWW_ROOT/mod
    # you will need to change this path!!!
    cp -r /path/to/repo/aspire-moodle-integration/moodle-activity-module-lti-wrapper/mod/aspirelists .
  7. Then go into moodle and complete the installation steps and configure the plugin as usual. https://localhost:8000/admin
  8. When you're done...
    # stop the containers but preserving data
    bin/moodle-docker-compose stop 
    
    # take the containers down and will LOOSE data
    # good if you want to start again. Not good if you don't
    bin/moodle-docker-compose down 
  9. And to start again...
    bin/moodle-docker-compose start
    # or
    bin/moodle-docker-compose up
Clone this wiki locally