Code Monkey home page Code Monkey logo

dockerised-moodledev's Introduction

docker-moodle-dev

Set up Docker containers for developing Moodle on Mac OS X.

The PHP code of Moodle is mounted from the host's subdirectory ./moodle.

Note that this configuration uses PostgreSQL as database and not MySQL.

All the scripts must be run from the directory containing Dockerfile and docker-compose.yml.

Setup

Requires Docker and Docker-machine VM to be installed, and optionally Docker-compose as well.

Create a subdirectory named moodle, containing the moodle installation to be used. Possibly clone it from git:

git clone -b MOODLE_29_STABLE git://git.moodle.org/moodle.git

Moodle config

The moodle-config.php file contains Moodle configuration.

This is based on Moodle 2.6 config file. Change it as required, without removing references to environment variables (getenv(...)) used to dockerise Moodle.

This file will be copied into the ./moodle subdirectory, renamed to config.php (Note that config.php is ignored in the standard Moodle git repo, so there is no risk to commit it by mistake).

Start Docker machine

A Docker machine (VM) must be running on the host:

./start-dockermachine.sh

Starts a VM named default_(if does not exist yet)

Build and run containers

Two approaches are available:

  • Run using Docker-compose
  • Run manually, using scripts

Use Docker-compose

The IP of the Docker-machine VM is hardwired in docker-compose.yml. If the VM uses an IP different from 192.169.99.100, the file must be changed accordingly.

TODO Make VM IP parametric

Build and start services

docker-compose up -d

Install Moodle

Edit install-moodle.sh to change the site language, name and admin account.

./install-moodle.sh

Note that stopped services retain their state. If restarted using docker-compose up there is no need to reinstall Moodle.

Stop containers

docker-compose stop

Directly using Docker

This approach uses bash script to build and start containers, and to install Moodle.

The scripts automatically detect the IP used by the Docker-machine VM.

Build images

./build-images.sh

Start containers

./start-containers.sh

Install moodle

./install-moodle.sh

TODO Externalise all parameters in a single file

dockerised-moodledev's People

Contributors

nicusx avatar

Watchers

James Cloos avatar Michael Schaar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.