diff options
author | Alex Brandt <alunduil@alunduil.com> | 2016-08-19 23:58:44 +0300 |
---|---|---|
committer | Alex Brandt <alunduil@alunduil.com> | 2016-08-19 23:58:44 +0300 |
commit | 90713d051e1b25d4b15b2dcb1e6c8973ffbe942d (patch) | |
tree | 502f06d4a6e50f725324cf834eccc30d87faaf9c /Dockerfile | |
parent | 9debc387241665323e51a02494df32ce9e92a909 (diff) |
ensure htaccess files are used
The htaccess files contain a few rewrites that ensure basic hiding of
scripts that shouldn't be accessed is enforded. This commit is based on
the changes in pull request #298 (thanks goes to @minad).
Also in this commit is a re-ordering of Dockerfile statements to
leverage caching when working on the apache configuration. There are
probably other improvements to be made but I'm not enough of a PHP
expert to spot them.
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Dockerfile b/Dockerfile index a28e85790..3e0f70b77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:8.0 +FROM debian:jessie MAINTAINER Alex Brandt <alunduil@alunduil.com> EXPOSE 80 443 @@ -6,26 +6,28 @@ EXPOSE 80 443 RUN apt-get -qq update RUN apt-get install -qq apache2-mpm-event ca-certificates +RUN apt-get install -qq php5 php-pear php5-mysql php5-pgsql php5-sqlite +RUN pear install mail_mime mail_mimedecode net_smtp net_idna2-beta auth_sasl net_sieve crypt_gpg + +RUN a2enmod expires +RUN a2enmod headers +RUN a2enmod ssl + RUN sed -e 's|/var/www/html|/var/www/public_html|' -e 's@\(Log \+\)[^ ]\+@\1"|/bin/cat"@' -i /etc/apache2/sites-available/000-default.conf +RUN sed -e 's|</VirtualHost>|\t<Directory /var/www/public_html/>\n\t\tAllowOverride All\n\t</Directory>\n&|' -i /etc/apache2/sites-available/000-default.conf RUN a2ensite 000-default RUN sed -e 's|/var/www/html|/var/www/public_html|' -e 's@\(Log \+\)[^ ]\+@\1"|/bin/cat"@' -i /etc/apache2/sites-available/default-ssl.conf +RUN sed -e 's|</VirtualHost>|\t<Directory /var/www/public_html/>\n\t\tAllowOverride All\n\t</Directory>\n&|' -i /etc/apache2/sites-available/default-ssl.conf RUN sed -e '/SSLCertificateKeyFile/s|ssl-cert-snakeoil.key|ssl-cert.key|' -e '/SSLCertificateFile/s|ssl-cert-snakeoil.pem|ssl-cert.pem|' -i /etc/apache2/sites-available/default-ssl.conf RUN ln -snf ssl-cert-snakeoil.pem /etc/ssl/certs/ssl-cert.pem RUN ln -snf ssl-cert-snakeoil.key /etc/ssl/private/ssl-cert.key RUN a2ensite default-ssl -RUN a2enmod expires -RUN a2enmod headers -RUN a2enmod ssl - -RUN apt-get install -qq php5 php-pear php5-mysql php5-pgsql php5-sqlite -RUN pear install mail_mime mail_mimedecode net_smtp net_idna2-beta auth_sasl net_sieve crypt_gpg - RUN rm -rf /var/www ADD . /var/www -RUN echo -e '<?php\n$config = array();\n' > /var/www/config/config.inc.php +RUN echo '<?php\n$config = array();' > /var/www/config/config.inc.php RUN rm -rf /var/www/installer RUN . /etc/apache2/envvars && chown -R ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /var/www/temp /var/www/logs |