From ca80c233b22bb4a2a5a6b8a992bdcafc4c8b42a2 Mon Sep 17 00:00:00 2001 From: Andrei Condurachi Date: Sat, 21 Nov 2020 22:26:27 +0200 Subject: [PATCH] updates --- Dockerfile | 6 +----- run.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3966c26..d8a17f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,10 +42,6 @@ RUN apk add --no-cache \ vim \ shadow -# syslog option '-Z' was changed to '-t', change this in /etc/conf.d/syslog so that syslog (and then cron) actually starts -# https://gitlab.alpinelinux.org/alpine/aports/-/issues/9279 -RUN sed -i 's/SYSLOGD_OPTS="-Z"/SYSLOGD_OPTS="-t"/g' /etc/conf.d/syslog - # Configure to use php fpm and don't use /var/www to store everything (modules and logs) RUN \ # Disable mpm_prefork @@ -116,4 +112,4 @@ VOLUME ["/var/www"] COPY run.sh /run.sh RUN chmod u+x /run.sh -CMD ["/run.sh"] \ No newline at end of file +CMD ["/run.sh"] diff --git a/run.sh b/run.sh index bbfbc4f..ee57fe7 100644 --- a/run.sh +++ b/run.sh @@ -1,14 +1,22 @@ #!/bin/sh +# syslog option '-Z' was changed to '-t', change this in /etc/conf.d/syslog so that syslog (and then cron) actually starts +# https://gitlab.alpinelinux.org/alpine/aports/-/issues/9279 +exec sed -i 's/SYSLOGD_OPTS="-Z"/SYSLOGD_OPTS="-t"/g' /etc/conf.d/syslog + # Create cron job for Grav maintenance scripts (crontab -l; echo "* * * * * cd /var/www/html;/usr/bin/php bin/grav scheduler 1>> /dev/null 2>&1") | crontab - # Cron requires that each entry in a crontab end in a newline character. If the last entry in a crontab is missing the newline, cron will consider the crontab (at least partially) broken and refuse to install it. (crontab -l; echo "") | crontab - +# syslog option '-Z' was changed to '-t', change this in /etc/conf.d/syslog so that syslog (and then cron) actually starts +# https://gitlab.alpinelinux.org/alpine/aports/-/issues/9279 +RUN sed -i 's/SYSLOGD_OPTS="-Z"/SYSLOGD_OPTS="-t"/g' /etc/conf.d/syslog + # Start Apache, PHP-FPM and Cron exec /usr/sbin/httpd -D FOREGROUND -f /etc/apache2/httpd.conf & exec /usr/sbin/php-fpm7 -F exec crond # Make sure apache can read&right to logs and docroot -RUN chown -R apache:apache /var/log/apache2 /var/www \ No newline at end of file +RUN chown -R apache:apache /var/log/apache2 /var/www