Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/3.x/3.6.0' into 3.x-master
- Loading branch information
Showing
37 changed files
with
223 additions
and
6,341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,65 @@ | ||
FROM drupal:10-php8.1 | ||
# Stage 1: Build the application | ||
FROM drupal:10-php8.1 as builder | ||
|
||
# Set timezone to Australia/Sydney by default | ||
RUN ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime | ||
|
||
RUN apt-get update && \ | ||
apt-get install -q -y libicu-dev sqlite3 mariadb-client git unzip rsync nano && \ | ||
apt-get autoclean && \ | ||
apt-get autoremove && \ | ||
# Install required packages and PHP extensions | ||
RUN \ | ||
--mount=type=cache,target=/var/cache/apt \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends libicu-dev sqlite3 mariadb-client git unzip rsync sudo && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
docker-php-ext-configure intl && \ | ||
docker-php-ext-install intl | ||
|
||
# Configure PHP settings | ||
RUN echo "memory_limit = 512M" >> /usr/local/etc/php/conf.d/docker-php-ram-limit.ini && \ | ||
echo "upload_max_filesize = 100M" >> /usr/local/etc/php/conf.d/docker-php-upload-limit.ini && \ | ||
echo "post_max_size = 100M" >> /usr/local/etc/php/conf.d/docker-php-upload-limit.ini | ||
|
||
# Set Composer environment variables | ||
ENV COMPOSER_ALLOW_SUPERUSER=1 | ||
ENV COMPOSER_MEMORY_LIMIT=-1 | ||
ENV SIMPLETEST_BASE_URL="http://localhost" | ||
ENV SIMPLETEST_DB='mysql://drupal:drupal@mariadb/drupal' | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy only the necessary files for dependency installation | ||
COPY composer.json ./ | ||
|
||
# Install Composer dependencies | ||
RUN \ | ||
--mount=type=cache,mode=0777,target=/root/.composer/cache \ | ||
composer config --no-plugins allow-plugins.phpstan/extension-installer 1 && \ | ||
composer require palantirnet/drupal-rector drupal/core-dev:"^10.0" mglaman/drupal-check --dev --no-update && \ | ||
composer update --no-scripts --no-autoloader && \ | ||
cp vendor/palantirnet/drupal-rector/rector.php . | ||
|
||
# Create a symbolic link | ||
RUN rm -rf /opt/drupal && \ | ||
ln -sf /app/web /var/www/html | ||
|
||
# Stage 2: Final application image | ||
FROM builder as site | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the rest of the application files | ||
COPY . /app/ | ||
|
||
# RUN --mount=type=secret,id=github_token,dst=/app/auth.json set -eux; \ | ||
RUN set -eux; \ | ||
composer update; \ | ||
composer config --no-plugins allow-plugins.phpstan/extension-installer 1;\ | ||
composer require palantirnet/drupal-rector \ | ||
drupal/core-dev:"^10.0" \ | ||
mglaman/drupal-check --dev; \ | ||
cp vendor/palantirnet/drupal-rector/rector.php .; | ||
|
||
RUN set -eux; \ | ||
chown -R www-data:www-data web/sites web/modules web/themes; \ | ||
rm -rf /opt/drupal; \ | ||
ln -sf /app/web /var/www/html; | ||
|
||
ENV PATH=${PATH}:/app/bin | ||
# Configure Composer | ||
RUN \ | ||
--mount=type=cache,mode=0777,target=/root/.composer/cache \ | ||
composer config --no-plugins allow-plugins.phpstan/extension-installer 1 && \ | ||
composer install | ||
|
||
# Adjust ownership | ||
RUN chown -R www-data:www-data web/sites web/modules web/themes | ||
|
||
# Set the PATH environment variable | ||
ENV PATH=${PATH}:/app/bin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.