Skip to content

philippgitpush/moodle-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moodle Docker Compose

This repository provides a Docker Compose setup for Moodle, allowing you to quickly spin up a local Moodle development environment with all necessary dependencies. It includes PHP, MySQL, phpMyAdmin, and a cron service for background tasks.

This setup is designed for development and testing, but can be adapted for production with proper security measures.


Getting Started

  1. Clone the repository:
git clone <repo-url>
cd <repo-folder>
  1. Download Moodle:

Download the latest Moodle version from Moodle downloads and extract it into a moodle folder:

moodle/ */ ← place extracted Moodle files here
moodledata/ */ ← Moodle data folder (will be created automatically if missing)

  1. Start the containers:
docker-compose up -d
  1. Access your services:
  1. Adjust Permissions:

For this, see perms.sh

Dockerfile Overview

  • Base image: php:8.4-apache
  • Installed extensions: gd, pdo, pdo_mysql, zip, mysqli, intl, soap, exif
  • Apache modules: rewrite, deflate, filter, expires
  • Custom PHP config: php/custom-php.ini
  • Locale: C.UTF-8

Notes for Production

  • Do not expose phpMyAdmin (8080) to the public.
  • Bind MySQL to 127.0.0.1 (Windows) or 172.17.0.1 (Linux/macOS) in production to prevent public access.
  • Always secure your MySQL credentials before deploying.

About

Moodle LAMP Server with Docker Compose (PHP, Apache, MySQL, phpMyAdmin)

Topics

Resources

Stars

Watchers

Forks