Difference between revisions of "Dockerfile.isoweb"
From Cactus Howto
Jump to navigationJump to search(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[configure_apache2.sh]] |
|||
<pre> |
<pre> |
||
tim@ubuntu:~/docker/isoweb$ cat Dockerfile |
|||
FROM ubuntu:14.04.1 |
FROM ubuntu:14.04.1 |
||
MAINTAINER itsecorg@cactus.de |
MAINTAINER itsecorg@cactus.de |
||
# Install apache, PHP, and supplimentary programs. curl and lynx-cur are for debugging the container. |
|||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ |
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ |
||
Line 8: | Line 12: | ||
RUN a2enmod ssl |
RUN a2enmod ssl |
||
RUN a2enmod php5 |
RUN a2enmod php5 |
||
#RUN a2enmod rewrite |
|||
# Update the PHP.ini file, enable <? ?> tags and quieten logging. |
# Update the PHP.ini file, enable <? ?> tags and quieten logging. |
||
# RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php5/apache2/php.ini |
|||
⚫ | |||
# RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php5/apache2/php.ini |
|||
⚫ | RUN sed -i.orig -e "s/^memory_limit\s*=.*/memory_limit = 200M/" -e "s/^max_execution_time\s*=.*/max_execution_time = 900/" -e "s/^default_charset\s*=.*/default_charset = \"utf\-8\"/" -e "s|^include_path\s*=.*|include_path = \"/usr/share/php:/usr/share/lib/php:/usr/share/itsecorg/web/include:/etc:/usr/share/itsecorg/web/htdocs/inctxt:/usr/share/itsecorg/web/htdocs/hilfe\"|" -e "s|^doc_root\s*=.*|doc_root = /usr/share/itsecorg/web|" -e "s/^sql\.safe_mode\s*=.*/sql.safe_mode = On/" -e "s/^expose_php\s*=.*/expose_php = Off/" -e "s/^display_startup_errors\s*=.*/display_startup_errors = Off/" -e "s/^error_log\s*=.*/error_log = syslog/" -e "s/^log_errors_max_len\s*=.*/log_errors_max_len = 0/" -e "s/^pgsql\.log_notice\s*=.*/pgsql.log_notice = 1/" -e "s|^session\.save_path\s*=.*|session.save_path = /var/itsecorg/session|" -e "s/^session\.gc_maxlifetime\s*=.*/session\.gc_maxlifetime = 14400/" /etc/php5/apache2/php.ini /etc/php5/cli/php.ini |
||
ENV APACHE_RUN_USER www-data |
ENV APACHE_RUN_USER www-data |
||
ENV APACHE_RUN_GROUP www-data |
ENV APACHE_RUN_GROUP www-data |
||
ENV APACHE_RUN_DIR /var/run/ |
|||
ENV APACHE_LOG_DIR /var/log/apache2 |
ENV APACHE_LOG_DIR /var/log/apache2 |
||
ENV APACHE_LOCK_DIR /var/lock/apache2 |
ENV APACHE_LOCK_DIR /var/lock/apache2 |
||
Line 21: | Line 29: | ||
ADD web /usr/share/itsecorg/web |
ADD web /usr/share/itsecorg/web |
||
ADD configure_apache2.sh / |
ADD configure_apache2.sh / |
||
# Update the default apache site with the config we created. |
|||
ADD etc/httpd.conf /etc/apache2/sites-enabled/000-default.conf |
ADD etc/httpd.conf /etc/apache2/sites-enabled/000-default.conf |
||
COPY |
#COPY web /web |
||
COPY etc/ |
#COPY etc/httpd.conf /etc/apache2/sites-available/itsecorg.conf |
||
COPY etc/iso.conf /usr/share/itsecorg/etc/ |
|||
COPY etc/gui.conf /usr/share/itsecorg/etc/ |
|||
#USER www-data |
|||
#RUN a2ensite itsecorg.conf |
|||
RUN sh /configure_apache2.sh |
RUN sh /configure_apache2.sh |
||
EXPOSE 443 |
EXPOSE 443 |
Latest revision as of 09:29, 22 December 2014
tim@ubuntu:~/docker/isoweb$ cat Dockerfile FROM ubuntu:14.04.1 MAINTAINER itsecorg@cactus.de # Install apache, PHP, and supplimentary programs. curl and lynx-cur are for debugging the container. RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 libapache2-mod-php5 php5-pgsql php-pear sharutils openssl ssl-cert && \ DEBIAN_FRONTEND=noninteractive apt-get clean && rm -rf /var/lib/apt/lists/* RUN a2enmod ssl RUN a2enmod php5 #RUN a2enmod rewrite # Update the PHP.ini file, enable <? ?> tags and quieten logging. # RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php5/apache2/php.ini # RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php5/apache2/php.ini RUN sed -i.orig -e "s/^memory_limit\s*=.*/memory_limit = 200M/" -e "s/^max_execution_time\s*=.*/max_execution_time = 900/" -e "s/^default_charset\s*=.*/default_charset = \"utf\-8\"/" -e "s|^include_path\s*=.*|include_path = \"/usr/share/php:/usr/share/lib/php:/usr/share/itsecorg/web/include:/etc:/usr/share/itsecorg/web/htdocs/inctxt:/usr/share/itsecorg/web/htdocs/hilfe\"|" -e "s|^doc_root\s*=.*|doc_root = /usr/share/itsecorg/web|" -e "s/^sql\.safe_mode\s*=.*/sql.safe_mode = On/" -e "s/^expose_php\s*=.*/expose_php = Off/" -e "s/^display_startup_errors\s*=.*/display_startup_errors = Off/" -e "s/^error_log\s*=.*/error_log = syslog/" -e "s/^log_errors_max_len\s*=.*/log_errors_max_len = 0/" -e "s/^pgsql\.log_notice\s*=.*/pgsql.log_notice = 1/" -e "s|^session\.save_path\s*=.*|session.save_path = /var/itsecorg/session|" -e "s/^session\.gc_maxlifetime\s*=.*/session\.gc_maxlifetime = 14400/" /etc/php5/apache2/php.ini /etc/php5/cli/php.ini ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_RUN_DIR /var/run/ ENV APACHE_LOG_DIR /var/log/apache2 ENV APACHE_LOCK_DIR /var/lock/apache2 ENV APACHE_PID_FILE /var/run/apache2.pid # Copy site into place. ADD web /usr/share/itsecorg/web ADD configure_apache2.sh / # Update the default apache site with the config we created. ADD etc/httpd.conf /etc/apache2/sites-enabled/000-default.conf #COPY web /web #COPY etc/httpd.conf /etc/apache2/sites-available/itsecorg.conf COPY etc/iso.conf /usr/share/itsecorg/etc/ COPY etc/gui.conf /usr/share/itsecorg/etc/ #USER www-data #RUN a2ensite itsecorg.conf RUN sh /configure_apache2.sh EXPOSE 443 # Add VOLUMEs to allow backup of config, logs and databases VOLUME ["/etc/apache2", "/var/log/apache2", "/var/lib/apache2"] CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]