Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.67 KB

File metadata and controls

37 lines (25 loc) · 1.67 KB

Moodle on Codesphere

This repo contains everything necessary to be able to run a Moodle instance inside a Codesphere workspace.

Preperation

  1. Create a new PostgresDB Managed Service with moodle as the user name.
  2. Update the DB host and password the Moodle config at config/config.php(this file is copied into the Moodle root directory by the CI).
  3. Open a Terminal and create a new database using the db_init.sql script (below)
  4. Update the $CFG->wwwroot value in config/config.php with the actual host name (either Codesphere devDomain or custom domain).

DB Creation

Please run the "§Application Setup" once so that psql is installed. Then create a new database (replace DB host with your actual hostname!):

psql -U postgres -h <ms-postgres-INSTANCE-ms-postgres> -f config/db_init.sql

Getting started

  1. Create a Codesphere Workspace, cloning the current repo.
  2. After the workspace has been created, enter the CI & Deploy mode in Codesphere.
  3. In the left-side options, enter [Manage Execution]
  4. Select the [Prepare] stage and click [Run]
  5. Once the setup is done, select the [Run] stage and click [Sync]
  6. Once the services are deployed, click [Open Deployment] to enter the Moodle installation.

How it works

We run PHP's FastCGI Process Manager (php-fpm) to serve PHP. Then we start an NGINX instance for serving the static files and forwards to php-fpm for PHP files.

Improvements

Currently we are using Codespheres Workspace File System for the data directory (moodledata`). By default, this location is also used for caching. Moodle recommends to looks into alternative caching options like Redis to improve performance.