Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHP version to 7.4 for D7 #10

Open
wants to merge 1 commit into
base: classic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ RUN apt update && apt-get update && apt install apache2 -y && \
apt install mysql-server -y && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:ondrej/php && \
DEBIAN_FRONTEND=noninteractive apt install php7.3 -y && \
DEBIAN_FRONTEND=noninteractive apt install php7.3-dev php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-json php7.3-opcache php7.3-mysql php7.3-mbstring php7.3-zip php7.3-xml php7.3-xdebug -y
DEBIAN_FRONTEND=noninteractive apt install php7.4 -y && \
DEBIAN_FRONTEND=noninteractive apt install php7.4-dev php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-json php7.4-opcache php7.4-mysql php7.4-mbstring php7.4-zip php7.4-xml php7.4-xdebug -y

RUN update-alternatives --set php /usr/bin/php7.3 && \
update-alternatives --set phar /usr/bin/phar7.3 && \
update-alternatives --set phar.phar /usr/bin/phar.phar7.3 && \
update-alternatives --set phpize /usr/bin/phpize7.3 && \
update-alternatives --set php-config /usr/bin/php-config7.3
RUN update-alternatives --set php /usr/bin/php7.4 && \
update-alternatives --set phar /usr/bin/phar7.4 && \
update-alternatives --set phar.phar /usr/bin/phar.phar7.4 && \
update-alternatives --set phpize /usr/bin/phpize7.4 && \
update-alternatives --set php-config /usr/bin/php-config7.4

# Disable loading of xdebug.so
RUN rm -f /etc/php/7.3/cli/conf.d/20-xdebug.ini
RUN rm -f /etc/php/7.4/cli/conf.d/20-xdebug.ini

# Install AWS CLI
RUN apt-get install -y awscli
Expand All @@ -70,24 +70,23 @@ RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/bin/composer
RUN chmod +x /usr/bin/composer

# Allow composer superuser and set environment to use composer executables path
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV PATH "$PATH:/root/.composer/vendor/bin"

# Install Drush, PHPCS and Drupal Coding Standards
RUN composer global require "drush/drush:$DRUSH_VER"
RUN composer global require squizlabs/php_codesniffer
RUN composer global require drupal/coder

# Allow composer superuser
ENV COMPOSER_ALLOW_SUPERUSER 1

# Add Composer bin directory to PATH
ENV PATH="$PATH:/root/.config/composer/vendor/bin"

# Set Drupal as default CodeSniffer Standard
RUN phpcs --config-set installed_paths /root/.composer/vendor/drupal/coder/coder_sniffer/
RUN phpcs --config-set default_standard Drupal

# Move .composer to give way to the user's .composer config
RUN mv /root/.composer /root/composer

# Add local settings
COPY php-cli.ini /etc/php/7.3/cli/conf.d/z_php.ini
COPY php-cli.ini /etc/php/7.4/cli/conf.d/z_php.ini

# Add git completion for the cli
RUN curl -o ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
Expand All @@ -96,17 +95,14 @@ COPY bash.rc /root/.bashrc

WORKDIR /var/www

# Add Composer bin directory to PATH
ENV PATH /root/composer/vendor/bin:$PATH

# Startup script
COPY ./startup.sh /opt/startup.sh
RUN chmod +x /opt/startup.sh

# Starter script
ENTRYPOINT ["/opt/startup.sh"]

ENV PHP_INI_SCAN_DIR="/etc/php/7.3/cli/conf.d:/var/www/src/docker/etc/php"
ENV PHP_INI_SCAN_DIR="/etc/php/7.4/cli/conf.d:/var/www/src/docker/etc/php"

# By default, launch supervisord to keep the container running.
CMD /usr/bin/supervisord -n
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-include env_make

TAG ?= latest
TAG ?= classic
UBUNTU_VER ?= 20.04

ifeq ($(TAG), classic)
Expand Down