summaryrefslogtreecommitdiff
path: root/docker_builds/docker_wordpress_sendmail
diff options
context:
space:
mode:
Diffstat (limited to 'docker_builds/docker_wordpress_sendmail')
-rw-r--r--docker_builds/docker_wordpress_sendmail/Dockerfile15
-rw-r--r--docker_builds/docker_wordpress_sendmail/README.md72
-rw-r--r--docker_builds/docker_wordpress_sendmail/php.ini2
-rwxr-xr-xdocker_builds/docker_wordpress_sendmail/start.sh42
-rw-r--r--docker_builds/docker_wordpress_sendmail/uploads.ini5
5 files changed, 136 insertions, 0 deletions
diff --git a/docker_builds/docker_wordpress_sendmail/Dockerfile b/docker_builds/docker_wordpress_sendmail/Dockerfile
new file mode 100644
index 0000000..bd1a182
--- /dev/null
+++ b/docker_builds/docker_wordpress_sendmail/Dockerfile
@@ -0,0 +1,15 @@
+FROM wordpress
+
+LABEL maintainer="Michal Idziorek <m.i@gmx.at>"
+
+RUN apt-get update && apt-get install -y sendmail libjpeg-dev libpng-dev libfreetype6-dev && \
+ docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
+ docker-php-ext-install gd && \
+ a2enmod remoteip
+
+COPY ./php.ini /usr/local/etc/php/conf.d/php.ini
+COPY ./uploads.ini /usr/local/etc/php/conf.d/uploads.ini
+COPY ./start.sh /start.sh
+
+ENTRYPOINT [""]
+CMD ["/start.sh"]
diff --git a/docker_builds/docker_wordpress_sendmail/README.md b/docker_builds/docker_wordpress_sendmail/README.md
new file mode 100644
index 0000000..f0ee554
--- /dev/null
+++ b/docker_builds/docker_wordpress_sendmail/README.md
@@ -0,0 +1,72 @@
+# ABOUT
+This is a simple customization of the official wordpress docker image.
+
+- GitHub: https://github.com/miguelclean/docker_wordpress_sendmail/
+- Docker Hub: https://hub.docker.com/r/migueldirty/docker_wordpress_sendmail/
+
+# FEATURES
+- added sendmail functionality
+- an increased upload size (to 500M)
+- added GD with freetype, lib-jpeg, lib-png
+- added RemoteIPHeader config option
+
+# FILES & PROGRAMMS
+The following files and programms are added/installed to the official wordpress image:
+- /usr/sbin/sendmail - Mail Transport Agent (installed via apt)
+- /usr/local/etc/php/conf.d/php.ini - set sendmail\_path = sendmail -t -i
+- /usr/local/etc/php/conf.d/uploads.ini - increase upload size to 500M
+- customizing /etc/hosts by adding the FQDN specified with $HOSTS\_FQDN
+
+# USING THIS IMAGE
+You can specify the following in your *docker-compose.yml*:
+
+ build: https://github.com/miguelclean/docker_wordpress_sendmail.git
+
+You can also use this automatically built image from Docker Hub:
+
+ image: migueldirty/docker_wordpress_sendmail
+
+# ENVIRONMENT VARIABLES
+This customized image requires to specify HOSTS\_FQDN additionally:
+
+ HOSTS_FQDN: www.your-server.com
+
+Optionally you can set the header name to be used for RemoteIPHaeder in apache.
+
+ Example: REMOTE_IP: X-Real-IP
+
+
+# EXAMPLE CONFIG
+
+docker-compose.yml for a wordpress & mysql deployment using this image:
+
+
+ version: '2'
+
+ services:
+ db:
+ image: mysql:5.7
+ volumes:
+ - db_data:/var/lib/mysql
+ restart: always
+ environment:
+ MYSQL_ROOT_PASSWORD: wordpress
+ MYSQL_DATABASE: wordpress
+ MYSQL_USER: wordpress
+ MYSQL_PASSWORD: wordpress
+
+ wordpress:
+ depends_on:
+ - db
+ build: https://github.com/miguelclean/docker_wordpress_sendmail.git
+ volumes:
+ - wp_data:/var/www/html
+ restart: always
+ environment:
+ WORDPRESS_DB_HOST: db:3306
+ WORDPRESS_DB_PASSWORD: wordpress
+ HOSTS_FQDN: www.your-server.com
+ volumes:
+ db_data:
+ wp_data:
+
diff --git a/docker_builds/docker_wordpress_sendmail/php.ini b/docker_builds/docker_wordpress_sendmail/php.ini
new file mode 100644
index 0000000..09b3f6e
--- /dev/null
+++ b/docker_builds/docker_wordpress_sendmail/php.ini
@@ -0,0 +1,2 @@
+sendmail_path=sendmail -t -i
+
diff --git a/docker_builds/docker_wordpress_sendmail/start.sh b/docker_builds/docker_wordpress_sendmail/start.sh
new file mode 100755
index 0000000..d585433
--- /dev/null
+++ b/docker_builds/docker_wordpress_sendmail/start.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+_term() {
+ echo " -> Caught SIGTERM signal!"
+ kill -TERM "$child" 2>/dev/null
+}
+
+echo
+echo " == STARTING Miguel's Customized Wordpress Image == "
+echo
+
+echo " 0. Setting SIGTERM Trap..."
+trap _term SIGTERM
+
+echo " 1. Updating /etc/hosts..."
+echo " -> Setting hostname to $HOSTS_FQDN"
+echo "127.0.0.1 $(hostname) localhost $HOSTS_FQDN" >> /etc/hosts
+
+echo " 2. Set ServerName (Apache)"
+sed -i.bak 's/^ServerName.*//' /etc/apache2/apache2.conf
+echo ServerName localhost >> /etc/apache2/apache2.conf
+
+echo " 3. Restarting sendmail..."
+service sendmail restart
+
+echo " 4. Config RemoteIPHeader (Apache)"
+sed -i.bak 's/^RemoteIPHeader.*//' /etc/apache2/apache2.conf
+if [ -z "$REMOTE_IP" ]; then
+ echo " -> RemoteIPHeader not used"
+else
+ echo RemoteIPHeader $REMOTE_IP >> /etc/apache2/apache2.conf
+ echo " -> $REMOTE_IP"
+fi
+
+echo " 5. Launching Apache ..."
+docker-entrypoint.sh apache2-foreground &
+child=$!
+echo " -> sleeping (pid=$child) ..."
+wait "$child"
+echo
+echo " == STOPPED == "
+echo
diff --git a/docker_builds/docker_wordpress_sendmail/uploads.ini b/docker_builds/docker_wordpress_sendmail/uploads.ini
new file mode 100644
index 0000000..755332d
--- /dev/null
+++ b/docker_builds/docker_wordpress_sendmail/uploads.ini
@@ -0,0 +1,5 @@
+file_uploads = On
+memory_limit = 500M
+upload_max_filesize = 500M
+post_max_size = 500M
+max_execution_time = 600