This repo contains everything necessary to be able to run a Moodle instance inside a Codesphere workspace.
- Create a new PostgresDB Managed Service with
moodleas the user name. - 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). - Open a Terminal and create a new database using the
db_init.sqlscript (below) - Update the
$CFG->wwwrootvalue inconfig/config.phpwith the actual host name (either Codesphere devDomain or custom domain).
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- Create a Codesphere Workspace, cloning the current repo.
- After the workspace has been created, enter the CI & Deploy mode in Codesphere.
- In the left-side options, enter [Manage Execution]
- Select the [Prepare] stage and click [Run]
- Once the setup is done, select the [Run] stage and click [Sync]
- Once the services are deployed, click [Open Deployment] to enter the Moodle installation.
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.
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.