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
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
web:
image: richarvey/nginx-php-fpm
build: docker
dockerfile: DockerfileNginx
links:
- db
ports:
Expand Down
7 changes: 7 additions & 0 deletions docker/DockerfileNginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM richarvey/nginx-php-fpm

RUN apk add --no-cache sysklogd
ADD run-web.sh /
RUN chmod 755 /run-web.sh

CMD ["/run-web.sh"]
Empty file modified docker/run-mariadb.sh
100644 → 100755
Empty file.
48 changes: 48 additions & 0 deletions docker/run-web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

# fix php-fpm
sed -ri '
/^php_flag\[display_errors\]/ d
' /usr/local/etc/php-fpm.conf

# check if our changes were applied yet
if ! grep -E '^\[program:sysklogd\]$' /etc/supervisord.conf >&/dev/null; then
# fix php-fpm configs
sed -ri '
/^;?error_log/ c error_log = syslog
/^;?syslog.facility/ c syslog.facility = daemon
/^;?syslog.ident/ c syslog.ident = php-fpm
/^;?log_level/ c log_level = notice
' /usr/local/etc/php-fpm.d/*.conf

# add our own logging configuration
tee /usr/local/etc/php/conf.d/zzz-registration-system.ini >&/dev/null << END
[PHP]
error_reporting = E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = On
log_errors = On
ignore_repeated_errors = Off
ignore_repeated_source = Off
track_errors = On
html_errors = On
END

# fix nginx config access_log/error_log targets
sed -ri \
's/^([ \t]*)((access|error)_log) .*$/\1\2 syslog:server=unix:\/dev\/log,facility=local7,tag=nginx;/' \
/etc/nginx/sites-enabled/* /etc/nginx/nginx.conf

# cleanup logging options in supervisord (startup)
sed -ri '/^std(err|out)_.*=/ d' /etc/supervisord.conf
# add syslogger entry at the end of supervisord config
tee -a /etc/supervisord.conf >&/dev/null <<END
[program:sysklogd]
command = /usr/sbin/syslogd -d
autostart=true
autorestart=true
priority=1
END
fi

exec /start.sh