diff --git a/Dockerfile b/Dockerfile index 4d0a09d..e076aad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,8 +69,6 @@ RUN \ # Make sure PHP-FPM executes as apache user sed -i 's/user = nobody/user = apache/g' /etc/php7/php-fpm.d/www.conf && \ sed -i 's/group = nobody/group = apache/g' /etc/php7/php-fpm.d/www.conf && \ - # Allow apache user login - sed -i 's/apache(.*)\/sbin\/nologin/apache\1\/bin\/ash/g' /etc/passwd && \ # Prepare Apache log dir mkdir -p /var/log/apache2 && \ # Clean base directory diff --git a/run.sh b/run.sh index 07562f0..5fd1e13 100644 --- a/run.sh +++ b/run.sh @@ -1,10 +1,5 @@ #!/bin/sh -# Make sure apache can read&right to docroot -chown -R apache:apache /var/www -# Make sure apache can read&right to logs -chown -R apache:apache /var/log/apache2 - # 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 sed -i 's/SYSLOGD_OPTS="-Z"/SYSLOGD_OPTS="-t"/g' /etc/conf.d/syslog @@ -24,3 +19,10 @@ rc-update add php-fpm7 default && rc-service php-fpm7 start (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 - + +# Make sure apache can read&right to docroot +chown -R apache:apache /var/www +# Make sure apache can read&right to logs +chown -R apache:apache /var/log/apache2 +# Allow apache user login +sed -i 's/apache(.*)\/sbin\/nologin/apache\1\/bin\/ash/g' /etc/passwd