Maubic / moodle-docker-production

Moodle configuration for production site based on docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

moodle-docker-production: Docker Containers for Moodle

This repository contains Docker configuration aimed to provide a good starting point to install moodle in production using docker.

In Catedu we need to deploy several hundreds of Moodle. This repo aims to give us a solution to test locally our developments and to generate our docker images. Our final solution is being implemented in moodle-docker-deploy repo.

Features

  • Database servers: MySQL / MariaDB /PostGreSQL (MySQL in this repo)
  • Last supported PHP version
  • Zero-configuration approach
  • All php-extensions (thanks to moodlehq)

Missing Features

These features are out of the scope of this repo (you may have a look at moodle-docker-deploy repo):

  • Crontab configuration
  • Auto backup

Prerequisites

Quick start

cp env-sample .env
docker-compose up -d

Open browser webpage: http://localhost (be patient)

Configuration

  • Configure your moodle installation using an .env file

  • We have two environments: production (https ready with letsencrypt) and development (default).

  • Plugins or special configuration is done using shell scripts or php files. The moodle container executes them from init-scripts directory. We provide an example script (plugins-sampe.sh) file, and moodle image has moosh binary.

Activate https

  • Using letsEncrypt, activating production environment:

    cp docker-compose.override_prod.yml docker-compose.override.yml
    docker-compose up -d
    
  • Modify .env file

    MOODLE_URL=https://localhost
    SSL_PROXY=true
    

How to create a new image

  • Create a new directory with the selected Moodle version. For example for Moodlle 3.9.0 and using nginx-fpm (best choice):
cd ${REPO_DIR}
cp -r nginx-fpm/3.8.3 nginx-fpm/3.9.0
  • Modify files (Dockerfile, php extensions file, entrypoint...)
  • Commit and push so Docker Hub knows about the change to build new public image

Contributions

Are extremely welcome!

After installing. TODOs via web interface

  • Need to upload users

About

Moodle configuration for production site based on docker

License:GNU General Public License v3.0


Languages

Language:PHP 49.4%Language:Shell 41.4%Language:HTML 5.7%Language:Dockerfile 2.8%Language:JavaScript 0.7%