|
| 1 | +FROM php:7.3-apache AS cms_build |
| 2 | + |
| 3 | +ENV CMS_REPO_ROOT="/var/www/cms" |
| 4 | +ENV CMS_DOCROOT="$CMS_REPO_ROOT/docroot" |
| 5 | +ENV PHP_VERSION="7.3" |
| 6 | +ENV CMS_ENVIRONMENT_TYPE="eks" |
| 7 | + |
| 8 | +# Copy Composer into container rather than installing it. |
| 9 | +COPY --from=composer:2.1.8 /usr/bin/composer /usr/local/bin/composer |
| 10 | + |
| 11 | +# php-extension-installer makes working with PHP modules a lot easier |
| 12 | +COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ |
| 13 | + |
| 14 | +# Install VA internal certificate. |
| 15 | +ADD http://crl.pki.va.gov/PKI/AIA/VA/VA-Internal-S2-RCA1-v1.cer /usr/local/share/ca-certificates/ |
| 16 | +RUN openssl x509 -inform DER -in /usr/local/share/ca-certificates/VA-Internal-S2-RCA1-v1.cer -out /usr/local/share/ca-certificates/VA-Internal-S2-RCA1-v1.crt |
| 17 | +RUN update-ca-certificates |
| 18 | + |
| 19 | +# Use default production values. |
| 20 | +RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" |
| 21 | + |
| 22 | +# Inject PHP conf overrides. |
| 23 | +COPY .lando/zzz-lando-my-custom.ini $PHP_INI_DIR/conf.d/my-php.ini |
| 24 | + |
| 25 | +# Change docroot. |
| 26 | +RUN sed -ri -e 's#/var/www/html#${CMS_DOCROOT}#g' \ |
| 27 | + /etc/apache2/sites-available/*.conf \ |
| 28 | + && sed -ri -e 's#/var/www/#${CMS_DOCROOT}#g' \ |
| 29 | + /etc/apache2/apache2.conf \ |
| 30 | + /etc/apache2/conf-available/*.conf |
| 31 | + |
| 32 | +# Enable mod_rewrite. |
| 33 | +RUN a2enmod rewrite |
| 34 | + |
| 35 | +# Install dependencies |
| 36 | +RUN apt-get update \ |
| 37 | + && apt-get install -y \ |
| 38 | + # Git (for Composer/etc modules) |
| 39 | + git \ |
| 40 | + mariadb-client \ |
| 41 | + # unzip (for unzipping Composer zip files) |
| 42 | + unzip |
| 43 | + |
| 44 | +# Install PHP extensions. |
| 45 | +RUN install-php-extensions \ |
| 46 | + apcu \ |
| 47 | + bcmath \ |
| 48 | + bz2 \ |
| 49 | + calendar \ |
| 50 | + exif \ |
| 51 | + gd \ |
| 52 | + gettext \ |
| 53 | + imagick \ |
| 54 | + imap \ |
| 55 | + intl \ |
| 56 | + ldap \ |
| 57 | + mbstring \ |
| 58 | + memcached \ |
| 59 | + oauth \ |
| 60 | + pcntl \ |
| 61 | + memcache \ |
| 62 | + opcache \ |
| 63 | + pdo_mysql \ |
| 64 | + redis \ |
| 65 | + soap \ |
| 66 | + # NO STOP DIE DIE DIE |
| 67 | + # xdebug \ |
| 68 | + # Drush 10 requirement |
| 69 | + zip |
| 70 | + |
| 71 | +# Copy in the repository. |
| 72 | +COPY . $CMS_REPO_ROOT |
| 73 | +RUN chown -R www-data:www-data $CMS_REPO_ROOT/.. |
| 74 | + |
| 75 | +USER www-data |
| 76 | + |
| 77 | +WORKDIR $CMS_REPO_ROOT |
| 78 | + |
| 79 | +USER root |
| 80 | + |
0 commit comments