|
|
@@ -31,7 +31,23 @@ RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
|
|
|
&& echo 'always_populate_raw_post_data = -1\nmax_execution_time = 240\nmax_input_vars = 1500\nupload_max_filesize = 32M\npost_max_size = 32M' > $PHP_INI_DIR/conf.d/typo3.ini
|
|
|
|
|
|
# Enable Apache modules
|
|
|
-RUN a2enmod proxy_fcgi setenvif rewrite
|
|
|
+RUN a2enmod proxy_fcgi setenvif rewrite ssl
|
|
|
+
|
|
|
+RUN groupadd -r ssl-cert && usermod -a -G ssl-cert www-data
|
|
|
+RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
|
|
+ -keyout /etc/ssl/private/apache-selfsigned.key \
|
|
|
+ -out /etc/ssl/certs/apache-selfsigned.crt \
|
|
|
+ -subj "/C=US/ST=California/L=San Francisco/O=Localhost/OU=IT Department/CN=localhost"
|
|
|
+RUN chown -R root:ssl-cert /etc/ssl \
|
|
|
+ && chmod -R 640 /etc/ssl/private \
|
|
|
+ && chmod 640 /etc/ssl/private/apache-selfsigned.key
|
|
|
+
|
|
|
+ # Modify the default-ssl.conf file to use the self-signed SSL certificate and
|
|
|
+ # modify the document root in default-ssl.conf
|
|
|
+RUN sed -i 's|SSLCertificateFile\t/etc/ssl/certs/ssl-cert-snakeoil.pem|SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt|g' /etc/apache2/sites-available/default-ssl.conf \
|
|
|
+ && sed -i 's|SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key|SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key|g' /etc/apache2/sites-available/default-ssl.conf \
|
|
|
+ && sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' /etc/apache2/sites-available/default-ssl.conf \
|
|
|
+ && sed -i 's|<Directory /var/www/html>|<Directory /var/www/html/public>|g' /etc/apache2/sites-available/default-ssl.conf
|
|
|
|
|
|
# Modify the document root in 000-default.conf
|
|
|
RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' /etc/apache2/sites-available/000-default.conf \
|
|
|
@@ -44,6 +60,16 @@ RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
|
|
RUN apt-get install -y libcap2-bin \
|
|
|
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2
|
|
|
|
|
|
+RUN apt-get clean && \
|
|
|
+ apt-get -y purge \
|
|
|
+ libxml2-dev libfreetype6-dev \
|
|
|
+ libjpeg62-turbo-dev \
|
|
|
+ libmcrypt-dev \
|
|
|
+ libpng-dev \
|
|
|
+ libzip-dev \
|
|
|
+ zlib1g-dev && \
|
|
|
+ rm -rf /var/lib/apt/lists/* /usr/src/*
|
|
|
+
|
|
|
# Install Composer
|
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|