diff --git a/moodle/Dockerfile b/moodle/Dockerfile index 358e8b1..8c138d8 100644 --- a/moodle/Dockerfile +++ b/moodle/Dockerfile @@ -25,10 +25,6 @@ RUN curl -L https://github.com/tmuras/moosh/archive/refs/tags/1.21.tar.gz -o moo ln -s /moosh/moosh.php /usr/local/bin/moosh RUN /downloadMoodle.sh -RUN mkdir /bitnami/moodledata/lang && \ - MAJOR_MINOR=$(echo "$MOODLE_VERSION" | cut -d. -f1,2) && \ - curl -L https://download.moodle.org/download.php/direct/langpack/4.1/de.zip --output de.zip && \ - unzip de.zip -d /bitnami/moodledata/lang # Install plugins to the image RUN mkdir /plugins && /downloadPlugins.sh @@ -46,7 +42,6 @@ RUN echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen COPY --from=build "/moodle-${MOODLE_VERSION}.tgz" "/moodle-${MOODLE_VERSION}.tgz" COPY --from=build /moosh /moosh COPY --from=build /plugins /plugins -COPY --from=build /bitnami/moodledata/lang /bitnami/moodledata/lang COPY scripts/init/entrypoint.sh /scripts/entrypoint.sh COPY scripts/init/updateCheck.sh /scripts/updateCheck.sh @@ -66,6 +61,10 @@ RUN apt-get update && apt-get upgrade -y && \ # Install redis-php which is required for moodle to use redis RUN /phpRedisInstall.sh +RUN MAJOR_MINOR=$(echo "$MOODLE_VERSION" | cut -d. -f1,2) && \ + curl -L https://download.moodle.org/download.php/direct/langpack/${MAJOR_MINOR}/de.zip --output /tmp/de.zip + + RUN chown 1001:root -R /opt/bitnami RUN chown 1001:root -R /plugins diff --git a/moodle/scripts/init/entrypoint.sh b/moodle/scripts/init/entrypoint.sh index b138690..e22499c 100644 --- a/moodle/scripts/init/entrypoint.sh +++ b/moodle/scripts/init/entrypoint.sh @@ -105,6 +105,14 @@ upgrade_if_pending MODULE=dbp info "Replacing config files with ours" /bin/cp -p /moodleconfig/config.php /bitnami/moodle/config.php /bin/cp /moodleconfig/php.ini /opt/bitnami/php/etc/conf.d/php.ini + +if [ -f "/tmp/de.zip" ]; then \ + MODULE=dbp warn "Installing german language pack" + mkdir -p /bitnami/moodledata/lang + unzip -q /tmp/de.zip -d /bitnami/moodledata/lang + rm -f /tmp/de.zip +fi + upgrade_if_pending if [[ ! -f "$update_failed_path" ]] && [[ ! -f "$plugin_state_failed_path" ]]; then