diff --git a/bin/php54/Dockerfile b/bin/php54/Dockerfile index 257ced48ec..1ab59bec72 100644 --- a/bin/php54/Dockerfile +++ b/bin/php54/Dockerfile @@ -46,6 +46,9 @@ RUN pecl install xdebug-2.4.0RC4 && docker-php-ext-enable xdebug \ # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite diff --git a/bin/php56/Dockerfile b/bin/php56/Dockerfile index 1f483691b3..3f3c70cb13 100644 --- a/bin/php56/Dockerfile +++ b/bin/php56/Dockerfile @@ -32,6 +32,9 @@ RUN docker-php-ext-install curl \ # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite @@ -41,4 +44,4 @@ RUN a2enmod rewrite headers EXPOSE 80 EXPOSE 443 -ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file +ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff --git a/bin/php71/Dockerfile b/bin/php71/Dockerfile index 27787956fa..cff17d3307 100644 --- a/bin/php71/Dockerfile +++ b/bin/php71/Dockerfile @@ -46,6 +46,9 @@ RUN docker-php-ext-install -j$(nproc) gd # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite diff --git a/bin/php72/Dockerfile b/bin/php72/Dockerfile index f6edeac270..047a2e18a5 100644 --- a/bin/php72/Dockerfile +++ b/bin/php72/Dockerfile @@ -56,8 +56,11 @@ RUN docker-php-ext-install -j$(nproc) gd # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite # Enable apache modules -RUN a2enmod rewrite headers \ No newline at end of file +RUN a2enmod rewrite headers diff --git a/bin/php73/Dockerfile b/bin/php73/Dockerfile index e18ba87093..1954bcc9b9 100644 --- a/bin/php73/Dockerfile +++ b/bin/php73/Dockerfile @@ -53,6 +53,9 @@ RUN apt-get -y update && \ # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite @@ -60,4 +63,4 @@ RUN a2enmod ssl && a2enmod rewrite RUN a2enmod rewrite headers # Cleanup -RUN rm -rf /usr/src/* \ No newline at end of file +RUN rm -rf /usr/src/* diff --git a/bin/php74/Dockerfile b/bin/php74/Dockerfile index f8b7d99e8b..8656b3308d 100644 --- a/bin/php74/Dockerfile +++ b/bin/php74/Dockerfile @@ -80,6 +80,9 @@ libpng-dev && \ # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite diff --git a/bin/php8/Dockerfile b/bin/php8/Dockerfile index fc76afb609..19defd9c6c 100644 --- a/bin/php8/Dockerfile +++ b/bin/php8/Dockerfile @@ -94,6 +94,9 @@ libpng-dev && \ # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite diff --git a/bin/php81/Dockerfile b/bin/php81/Dockerfile index aa7f3508ff..35575f1317 100644 --- a/bin/php81/Dockerfile +++ b/bin/php81/Dockerfile @@ -93,6 +93,9 @@ libpng-dev && \ # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl +# create directory to store app files outside DOCUMENT ROOT +RUN mkdir /var/app + # Enable SSL support RUN a2enmod ssl && a2enmod rewrite diff --git a/docker-compose.yml b/docker-compose.yml index 4cb90d0d16..a7e01a3ef3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,7 @@ services: links: - database volumes: + - ${APP_DIR-./app}:/var/app:rw - ${DOCUMENT_ROOT-./www}:/var/www/html:rw - ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/php.ini - ${SSL_DIR-./config/ssl}:/etc/apache2/ssl/ diff --git a/sample.env b/sample.env index a0ae72a6e9..2bc8d8db9f 100644 --- a/sample.env +++ b/sample.env @@ -6,6 +6,7 @@ COMPOSE_PROJECT_NAME=lamp # Possible values: php54, php56, php71, php72, php73, php74, php8, php81 PHPVERSION=php8 +APP_DIR=./app DOCUMENT_ROOT=./www APACHE_DOCUMENT_ROOT=/var/www/html VHOSTS_DIR=./config/vhosts