Sunday, December 2, 2018

How to start Moodle on docker?

Software Required

- docker-compose version 1.22.0
- macOS High Sierra
- docker version 18.06.1-ce

Steps
  • Construct the docker-compose.xml as shown below
version: '2'

services:
  mariadb:
    image: 'bitnami/mariadb:latest'
    environment:
      - MARIADB_USER=bn_moodle
      - MARIADB_DATABASE=bitnami_moodle
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - 'mariadb_data:/bitnami'
  moodle:
    image: 'bitnami/moodle:latest'
    environment:
      - MARIADB_HOST=mariadb
      - MARIADB_PORT_NUMBER=3306
      - MOODLE_DATABASE_USER=bn_moodle
      - MOODLE_DATABASE_NAME=bitnami_moodle
      - ALLOW_EMPTY_PASSWORD=yes
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - 'moodle_data:/bitnami'
    depends_on:
      - mariadb

volumes:
  mariadb_data:
    driver: local
  moodle_data:
    driver: local
  • Run command below to pull the Moodle image 
docker-compose up -d

  • Browse to http://localhost

  • Login as user id: user and password: bitnami, Moodle console page is displayed


No comments: