From 2b0d55a4b6b8a1fea260e7cd57857718f8e15b2c Mon Sep 17 00:00:00 2001 From: Luca Rullo Date: Tue, 1 Mar 2022 15:41:08 +0100 Subject: [PATCH] Add: Dockerized Apache2 --- Dockerfile | 12 ++++++++++++ conf/apache-wordpress.conf | 18 ++++++++++++++++++ conf/envvars | 17 +++++++++++++++++ docker-compose.yml | 10 ++++++++++ start.sh | 4 ++++ 5 files changed, 61 insertions(+) create mode 100644 Dockerfile create mode 100644 conf/apache-wordpress.conf create mode 100644 conf/envvars create mode 100644 docker-compose.yml create mode 100755 start.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b88f76f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM registry.sindominio.net/debian +RUN apt-get update && \ + apt-get -qy install apache2 && \ + apt-get clean + +RUN a2enmod alias proxy proxy_fcgi + +EXPOSE 8000 + +ADD start.sh . + +CMD "/start.sh" diff --git a/conf/apache-wordpress.conf b/conf/apache-wordpress.conf new file mode 100644 index 0000000..459a0f5 --- /dev/null +++ b/conf/apache-wordpress.conf @@ -0,0 +1,18 @@ + + ServerName default + DocumentRoot /var/www/html + + + Options -Indexes +FollowSymLinks +MultiViews + AllowOverride All + Require all granted + + + + # 2.4.10+ can proxy to unix socket + SetHandler "proxy:fcgi://localhost:9000" + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + diff --git a/conf/envvars b/conf/envvars new file mode 100644 index 0000000..7110d15 --- /dev/null +++ b/conf/envvars @@ -0,0 +1,17 @@ +unset HOME + +if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then + SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}" +else + SUFFIX= +fi + +export APACHE_RUN_USER=www-data +export APACHE_RUN_GROUP=www-data +export APACHE_PID_FILE=/tmp/apache2$SUFFIX/apache2.pid +export APACHE_RUN_DIR=/tmp/apache2$SUFFIX +export APACHE_LOCK_DIR=/tmp/apache2$SUFFIX +export APACHE_LOG_DIR=/tmp/apache2$SUFFIX + +export LANG=C +export LANG diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9e7e35e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" +services: + apache2: + build: . + user: "1000:1000" + ports: + - 8088:80 + volumes: + - ./conf/envvars:/etc/apache2/envvars:ro + - ./conf/apache-wordpress.conf:/etc/apache2/sites-available/000-default.conf:ro diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..db7b41d --- /dev/null +++ b/start.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +apache2ctl start +tail -f /tmp/apache2/*log