-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PM-45594 allow running arbitrary Moodle versions in docker setup
This now allows running main as well as stable branches. But it's not quite finished yet: Mounting the plugin folder is still missing.
- Loading branch information
Showing
3 changed files
with
49 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# See https://moodledev.io/general/development/policies/php for the list of available PHP versions. | ||
# Different versions of Moodle require different versions of PHP. | ||
ARG PHP_VERSION="8.1" | ||
|
||
FROM moodlehq/moodle-php-apache:${PHP_VERSION} | ||
|
||
# See https://moodledev.io/general/releases for the list of available versions. | ||
# See https://github.com/moodle/moodle/branches for the available branches. | ||
# Branch names follow the pattern MOODLE_XYZ_STABLE, e.g. MOODLE_404_STABLE for Moodle 4.4. | ||
# main is the default and most up-to-date branch, it includes upcoming versions before they are stable. | ||
ARG MOODLE_BRANCH="main" | ||
ENV MOODLE_BRANCH=${MOODLE_BRANCH} | ||
|
||
RUN git clone git://git.moodle.org/moodle.git /var/www/html --depth=1 --branch ${MOODLE_BRANCH} | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
ENTRYPOINT ["entrypoint.sh"] | ||
CMD ["apache2-foreground"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# see https://docs.moodle.org/404/en/Installing_Moodle#Command_line_installer | ||
chown -R www-data /var/www/html | ||
|
||
# TODO: Make moodle default user "user" and not "admin" | ||
su - www-data -s /bin/bash -c "php /var/www/html/admin/cli/install.php --non-interactive --agree-license --allow-unstable --wwwroot=$MOODLE_HOST --dataroot=/var/www/moodledata --dbtype=mariadb --dbhost=$MOODLE_DATABASE_HOST --dbname=moodle --dbuser=moodle --dbport=$MOODLE_DATABASE_PORT_NUMBER --fullname=Moodle --shortname=moodle --adminuser=user --adminpass=$MOODLE_PASSWORD [email protected] [email protected]" | ||
|
||
exec /usr/local/bin/moodle-docker-php-entrypoint "$@" |