Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 0 additions & 94 deletions php82-moodle/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions php82-moodle/php-fpm.conf

This file was deleted.

7 changes: 0 additions & 7 deletions php82-moodle/xx-moodle.ini

This file was deleted.

15 changes: 10 additions & 5 deletions php83-moodle-unit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM alpine:edge

ENV COMPOSER_HASH dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6
ENV COMPOSER_HASH=dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6

ENV PHPRUN_DEPS \
curl \
ENV PHPRUN_DEPS="curl \
git \
libxml2-utils \
libxslt \
Expand All @@ -13,8 +12,9 @@ ENV PHPRUN_DEPS \
openssh-client \
patch \
rsync \
s6-overlay \
sqlite \
wget
wget"

RUN set -e \
&& apk --update upgrade \
Expand Down Expand Up @@ -81,8 +81,13 @@ COPY conf.json /var/lib/unit/

COPY xx-moodle.ini /etc/php83/conf.d/xx-moodle.ini

COPY cron.sh /usr/local/bin/cron.sh
COPY crontab /etc/crontabs/root

COPY services /etc/services.d/

WORKDIR /var/www/html

EXPOSE 80

CMD ["unitd", "--no-daemon", "--user", "web-user", "--group", "web-group", "--log", "/dev/stdout"]
ENTRYPOINT ["/init"]
22 changes: 22 additions & 0 deletions php83-moodle-unit/cron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

reduce_cron_verbosity() {
while IFS= read -r line; do
case "$line" in
*"Continuing to check for tasks for"*) ;;
"Ran 0 adhoc tasks found"*) ;;
"Cron run completed correctly"*) ;;
"..."*) ;;
"") ;;
*) echo "$(date +"%Y/%m/%d %H:%M:%S") [cron] $line" ;;
esac
done
}

if [ -f /var/www/html/web/admin/cli/cron.php ]; then
echo "$(date +"%Y/%m/%d %H:%M:%S") [cron] Cron execution started" 1>&2
php /var/www/html/web/admin/cli/cron.php | reduce_cron_verbosity 1>&2
echo "$(date +"%Y/%m/%d %H:%M:%S") [cron] Cron execution finished" 1>&2
else
echo "$(date +"%Y/%m/%d %H:%M:%S") [cron] Moodle cron script not found" 1>&2
fi
1 change: 1 addition & 0 deletions php83-moodle-unit/crontab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* * * * * /usr/local/bin/cron.sh >> /dev/stdout 2>&1
3 changes: 3 additions & 0 deletions php83-moodle-unit/services/cron/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec crond -f 2>&1
3 changes: 3 additions & 0 deletions php83-moodle-unit/services/unit/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec unitd --no-daemon --user web-user --group web-group --log /dev/stdout