Commit 23eaa282 authored by Dave Lane's avatar Dave Lane
Browse files

trial commit of updates

parents 4ced272d 182be7aa
FROM oeru/php7.0-fpm-jessie
MAINTAINER Dave Lane <dave@oerfoundation.org> (@lightweight)
# install cron and msmtp for outgoing email
RUN apt-get install -y cron
RUN apt-get install -y curl
RUN rm -rf /var/lib/apt/lists/*
# note: cron is already installed.
# set up cron tasks
RUN echo '# cron jobs for Multisite Wordpress - dave@oerfoundation.org' > /etc/cron.d/wpms-cron
RUN echo '# see https://mautic.org/docs/en/setup/cron_jobs.html for details' >> /etc/cron.d/wpms-cron
RUN echo 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin' >> /etc/cron.d/wpms-cron
RUN echo 'OUT=/var/log/cron.log' >> /etc/cron.d/wpms-cron
RUN echo '# Run cron every 5 minutes' >> /etc/cron.d/wpms-cron
RUN echo '*/5 * * * * www-data php /var/www/html/wp-cron.php >> $OUT' >> /etc/cron.d/wpms-cron
RUN echo '# Just testing' >> /etc/cron.d/wpms-cron
RUN echo '*/5 * * * * www-data echo "Running cron at $(date)" >> $OUT ' >> /etc/cron.d/wpms-cron
RUN echo '# empty line' >> /etc/cron.d/wpms-cron
RUN set -ex \
&& { \
echo '# cron jobs for Multisite Wordpress - dave@oerfoundation.org'; \
echo 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'; \
echo 'OUT=/var/log/cron.log'; \
echo '# cron every 5 minutes'; \
echo '*/5 * * * * www-data php /var/www/html/wp-cron.php >> $OUT'; \
echo '# Just testing'; \
echo '*/5 * * * * www-data echo "Running cron at $(date)" >> $OUT '; \
echo '# empty line'; \
} | tee /etc/cron.d/wpms-cron
RUN touch 0644 /var/log/cron.log
......
# enable if running Wordpress
# cron job for Wordpress - dave@oerfoundation.org
# Run every minute
* * * * * root echo "running cron at `date`" >> /var/log/cron.log 2>&1
* * * * * root curl --silent http://nginx/wp-includes/cron.php >> /var/log/cron.log 2>&1
#
......@@ -5,7 +5,7 @@
#
server {
# add [IP-Address:]80 in the next line if you want to limit this to a single interface
listen 80;
listen 0.0.0.0:80;
server_name YOUR_DOMAIN;
root YOUR_WPMS_DIR;
index index.php;
......@@ -34,7 +34,7 @@ server {
# you!?)... https://letsencrypt.org
server {
# add [IP-Address:]443 ssl in the next line if you want to limit this to a single interface
listen 443 ssl;
listen 0.0.0.0:443 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem;
......@@ -53,7 +53,7 @@ server {
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://localhost:YOUR_PORT;
proxy_pass http://127.0.0.1:YOUR_PORT;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Conection "upgrade";
proxy_set_header Host $http_host;
......
......@@ -3,7 +3,7 @@
#
server {
# add [IP-Address:]80 in the next line if you want to limit this to a single interface
listen 80;
listen 0.0.0.0:80;
server_name YOUR_DOMAIN;
......@@ -16,7 +16,7 @@ server {
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://localhost:YOUR_PORT;
proxy_pass http://127.0.0.1:YOUR_PORT;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Conection "upgrade";
proxy_set_header Host $http_host;
......
......@@ -9,13 +9,13 @@
#
# using subdir approach, not subdomain...
map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
}
map $blogname $blogid{
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
include /var/www/html/wp-content/uploads/nginx-helper/map.conf;
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
include /var/www/html/wp-content/uploads/nginx-helper/map.conf;
}
# statements for each of your virtual hosts to this file
......
......@@ -6,7 +6,7 @@ ENV PHPREDIS_VERSION 3.1.4
# Install PHP extensions
RUN apt-get update && apt-get install -y apt-utils git less libbz2-dev libc-client-dev \
libcurl4-gnutls-dev libicu-dev libkrb5-dev libmcrypt-dev libpng-dev \
libpspell-dev libssl-dev libxml2-dev mariadb-client telnet unzip zip
libpspell-dev libssl-dev libxml2-dev mariadb-client sudo telnet unzip zip
RUN apt-get install -y net-tools vim dnsutils
# install cron and msmtp for outgoing email
RUN apt-get install -y cron msmtp
......@@ -27,36 +27,47 @@ RUN docker-php-source extract \
&& mv wp-cli.phar /usr/local/bin/wp
# address app-specific config requirements
RUN echo "log_errors = on" > /usr/local/etc/php/conf.d/php.ini
RUN echo "display_errors = off" >> /usr/local/etc/php/conf.d/php.ini
RUN echo "always_populate_raw_post_data = -1" >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'date.timezone = "Pacific/Auckland"' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'cgi.fix_pathinfo = 0' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'sendmail_path = /usr/bin/msmtp -t' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'upload_max_filesize = 100M' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'post_max_size = 150M' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'memory_limit = 250M' >> /usr/local/etc/php/conf.d/php.ini
# OpCache work
RUN echo '[opcache]' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.enable = 1' >> /usr/local/etc/php/conf.d/php.ini
#RUN echo 'opcache.enable_cli = 1' >> /usr/local/etc/php/conf.d/php.ini
#RUN echo 'opcache.interned_strings_buffer = 8' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.memory_consumption = 128' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.max_accelerated_files = 8000' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.revalidate_freq = 60' >> /usr/local/etc/php/conf.d/php.ini
#RUN echo 'opcache.fast_shutdown = 1' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.use_cwd = 1' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.validate_timestamps = 1' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.save_comments = 1' >> /usr/local/etc/php/conf.d/php.ini
RUN echo 'opcache.enable_file_override = 0' >> /usr/local/etc/php/conf.d/php.ini
# the PHP-fpm configuration
RUN echo 'security.limit_extensions = .php' >> /usr/local/etc/php-fpm.d/www.conf
RUN echo 'catch_workers_output = yes' >> /usr/local/etc/php-fpm.d/www.conf
RUN echo 'php_flag[display_errors] = off' >> /usr/local/etc/php-fpm.d/www.conf
RUN echo 'php_admin_value[error_log] = /usr/local/var/log/fpm-php.www.log' >> /usr/local/etc/php-fpm.d/www.conf
RUN echo 'php_admin_flag[log_errors] = on' >> /usr/local/etc/php-fpm.d/www.conf
RUN echo 'php_admin_value[memory_limit] = 250M' >> /usr/local/etc/php-fpm.d/www.conf
RUN set -ex \
&& { \
echo 'log_errors = on'; \
echo 'display_errors = off'; \
echo 'always_populate_raw_post_data = -1'; \
echo 'date.timezone = "Pacific/Auckland"'; \
echo 'cgi.fix_pathinfo = 0'; \
echo 'sendmail_path = /usr/bin/msmtp -t'; \
echo 'upload_max_filesize = 100M'; \
echo 'post_max_size = 150M'; \
echo 'memory_limit = 250M'; \
echo '[opcache]'; \
echo 'opcache.enable = 1'; \
echo 'opcache.memory_consumption = 128'; \
echo 'opcache.max_accelerated_files = 8000'; \
echo 'opcache.revalidate_freq = 60'; \
echo 'opcache.use_cwd = 1'; \
echo 'opcache.validate_timestamps = 1'; \
echo 'opcache.save_comments = 1'; \
echo 'opcache.enable_file_override = 0'; \
} | tee /usr/local/etc/php/conf.d/php.ini;
RUN set -ex \
&& { \
echo '[global]'; \
echo 'error_log = /proc/self/fd/2'; \
echo '[www]'; \
echo 'user = www-data'; \
echo 'group = www-data'; \
echo '; if we send this to /proc/self/fd/1, it never appears'; \
echo 'access.log = /proc/self/fd/2'; \
echo 'clear_env = no'; \
echo 'catch_workers_output = yes'; \
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
echo 'security.limit_extensions = .php'; \
echo '; process management stuff'; \
echo 'pm = ondemand'; \
echo 'pm.max_children = 20'; \
echo 'pm.start_servers = 2'; \
echo 'pm.min_spare_servers = 1'; \
echo 'pm.max_spare_servers = 3'; \
} | tee /usr/local/etc/php-fpm.d/www.conf;
VOLUME /var/www/html
......
......@@ -78,4 +78,11 @@ fi
# echo >&2 "vendor dependencies already in place."
#fi
if ! [ -e /usr/local/bin/wp ] ; then
echo >&2 "installing wp-cli as /usr/local/bin/wp!"
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
fi
exec "$@"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment