From b3a9284bfcd04d649df67322c750918902254398 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 10 Mar 2017 11:43:22 -0800 Subject: [PATCH 1/7] Allow PROJECT_ROOT to be universally used in fin custom commands (inside and outside cli) --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index aefde563..077297f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -253,6 +253,8 @@ ENV SSH_KEY_NAME id_rsa ENV SSH_AUTH_SOCK /.ssh-agent/proxy-socket # Set TERM so text editors/etc. can be used ENV TERM xterm +# Allow PROJECT_ROOT to be universally used in fin custom commands (inside and outside cli) +ENV PROJECT_ROOT /var/www # Starter script ENTRYPOINT ["/opt/startup.sh"] From f3b0cb482f9578a003205d79904a0989d68a256c Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Mon, 20 Mar 2017 14:19:22 -0700 Subject: [PATCH 2/7] Updated gosu to v1.10 --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 077297f0..7410450c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,8 +61,10 @@ RUN \ useradd -m -s /bin/bash -g users -G sudo -p docker docker && \ echo 'docker ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers -# Install gosu and give access to the users group to use it. gosu will be used to run services as a different user. -RUN curl -sSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" -o /usr/local/bin/gosu && \ +# Install gosu and give access to the users group to use it. +# gosu is used instead of sudo to start the main container process (pid 1) in a docker friendly way. +# https://github.com/tianon/gosu +RUN curl -sSL "https://github.com/tianon/gosu/releases/download/1.10/gosu-$(dpkg --print-architecture)" -o /usr/local/bin/gosu && \ chown root:users /usr/local/bin/gosu && \ chmod +sx /usr/local/bin/gosu From 2d5b047fe26f8fe4ada65c513a6809ee4aabcba5 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Mon, 20 Mar 2017 14:20:48 -0700 Subject: [PATCH 3/7] Optimized ENV usage --- Dockerfile | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7410450c..64a47ad0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -165,12 +165,12 @@ RUN gem install bundler # Home directory for bundle installs ENV BUNDLE_PATH .bundler -ENV COMPOSER_VERSION 1.3.0 -ENV DRUSH_VERSION 8.1.10 -ENV DRUPAL_CONSOLE_VERSION 1.0.0-rc16 -ENV MHSENDMAIL_VERSION 0.2.0 -ENV WPCLI_VERSION 1.1.0 -ENV MG_CODEGEN_VERSION 1.4 +ENV COMPOSER_VERSION=1.3.0 \ + DRUSH_VERSION=8.1.10 \ + DRUPAL_CONSOLE_VERSION=1.0.0-rc16 \ + MHSENDMAIL_VERSION=0.2.0 \ + WPCLI_VERSION=1.1.0 \ + MG_CODEGEN_VERSION=1.4 RUN \ # Composer curl -sSL "https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar" -o /usr/local/bin/composer && \ @@ -201,9 +201,9 @@ RUN git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR ln -s $HOME/.zprezto/runcoms/zshrc $HOME/.zshrc # Install nvm and a default node version -ENV NVM_VERSION 0.33.0 -ENV NODE_VERSION 6.10.0 -ENV NVM_DIR $HOME/.nvm +ENV NVM_VERSION=0.33.0 \ + NODE_VERSION=6.10.0 \ + NVM_DIR=$HOME/.nvm RUN \ curl -sSL https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | bash && \ . $NVM_DIR/nvm.sh && \ @@ -249,14 +249,15 @@ EXPOSE 22 WORKDIR /var/www -# Default SSH key name -ENV SSH_KEY_NAME id_rsa -# ssh-agent proxy socket (requires docksal/ssh-agent) -ENV SSH_AUTH_SOCK /.ssh-agent/proxy-socket -# Set TERM so text editors/etc. can be used -ENV TERM xterm -# Allow PROJECT_ROOT to be universally used in fin custom commands (inside and outside cli) -ENV PROJECT_ROOT /var/www +ENV \ + # Default SSH key name + SSH_KEY_NAME=id_rsa \ + # ssh-agent proxy socket (requires docksal/ssh-agent) + SSH_AUTH_SOCK=/.ssh-agent/proxy-socket \ + # Set TERM so text editors/etc. can be used + TERM=xterm \ + # Allow PROJECT_ROOT to be universally used in fin custom commands (inside and outside cli) + PROJECT_ROOT=/var/www # Starter script ENTRYPOINT ["/opt/startup.sh"] From 857a91d77d10ca20ded7a7006270e293a7d2ef87 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Mon, 20 Mar 2017 14:38:23 -0700 Subject: [PATCH 4/7] uid/gid overriding (moved from fin) - uid/gid of the docker user in cli can now be overridden via HOST_UID and HOST_GID env variables - root is now the default container user (a necessary evil), however startup.sh is switches root to docker when running any other than supervisord command - when using "docker exec" use the "-u docker" option, otherwise exec will run as root (as the default user) inside cli --- Dockerfile | 23 +++++++++++++++-------- startup.sh | 31 ++++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64a47ad0..6c018e3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,8 +57,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN \ - # Create a non-root user with access to sudo and the default group set to 'users' (gid = 100) - useradd -m -s /bin/bash -g users -G sudo -p docker docker && \ + # Create a non-root "docker" user (uid = 1000) with access to sudo and the default group set to 'users' (gid = 100) + useradd -m -s /bin/bash -u 1000 -g users -G sudo -p docker docker && \ echo 'docker ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # Install gosu and give access to the users group to use it. @@ -142,7 +142,7 @@ RUN mkdir -p /var/www/docroot && \ sed -i '/blackfire.agent_socket = /c blackfire.agent_socket = tcp://blackfire:8707' /etc/php5/mods-available/blackfire.ini && \ # Disable xdebug by default. We will enabled it at startup (see startup.sh) php5dismod xdebug && \ - # Create symlinks to project level overrides + # Create symlinks to project level overrides (if the source files are missing, nothing will break) ln -s /var/www/.docksal/etc/php/php.ini /etc/php5/fpm/conf.d/99-overrides.ini && \ ln -s /var/www/.docksal/etc/php/php-cli.ini /etc/php5/cli/conf.d/99-overrides.ini @@ -212,7 +212,9 @@ RUN \ # Install global node packages npm install -g npm && \ npm install -g yarn && \ - npm install -g bower + npm install -g bower && \ + # Fix npm complaining about permissions and not being able to update + sudo rm -rf $HOME/.config ENV PATH $PATH:$HOME/.composer/vendor/bin RUN \ @@ -241,8 +243,8 @@ COPY config/.docksalrc $HOME/.docksalrc COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY startup.sh /opt/startup.sh -# Fix permissions after COPY -RUN sudo chown -R docker:users $HOME +# Fix permissions after copy +RUN sudo chown -R $(id -u docker):$(id -g docker) $HOME EXPOSE 9000 EXPOSE 22 @@ -257,10 +259,15 @@ ENV \ # Set TERM so text editors/etc. can be used TERM=xterm \ # Allow PROJECT_ROOT to be universally used in fin custom commands (inside and outside cli) - PROJECT_ROOT=/var/www + PROJECT_ROOT=/var/www \ + # Allow matching host uid:gid + HOST_UID=1000 \ + HOST_GID=100 + +USER root # Starter script ENTRYPOINT ["/opt/startup.sh"] # By default, launch supervisord to keep the container running. -CMD ["gosu", "root", "supervisord"] +CMD ["supervisord"] diff --git a/startup.sh b/startup.sh index 9c76acdf..61a41450 100755 --- a/startup.sh +++ b/startup.sh @@ -1,5 +1,7 @@ #!/bin/bash +HOME_DIR='/home/docker' + # Copy Acquia Cloud API credentials # @param $1 path to the home directory (parent of the .acquia directory) copy_dot_acquia () @@ -7,8 +9,8 @@ copy_dot_acquia () local path="${1}/.acquia/cloudapi.conf" if [[ -f ${path} ]]; then echo "Copying Acquia Cloud API settings in ${path} from host..." - mkdir -p ~/.acquia - cp ${path} ~/.acquia + mkdir -p ${HOME_DIR}/.acquia + cp ${path} ${HOME_DIR}/.acquia fi } @@ -19,18 +21,25 @@ copy_dot_drush () local path="${1}/.drush" if [[ -d ${path} ]]; then echo "Copying Drush settigns in ${path} from host..." - cp -r ${path} ~ + cp -r ${path} ${HOME_DIR} fi } -# Copy Acquia Cloud API credentials from host if available +# Copy Acquia Cloud API credentials and Drush settings from host if available copy_dot_acquia '/.home' # Generic - -# Copy Drush settings from host if available copy_dot_drush '/.home' # Generic -# Reset home directory ownership -sudo chown $(id -u):$(id -g) -R ~ +## Docker user uid/gid mapping to the host user uid/gid +if [[ "$HOST_UID" != "" ]] && [[ "$HOST_GID" != "" ]]; then + if [[ "$HOST_UID" != "$(id -u docker)" ]] || [[ "$HOST_GID" != "$(id -g docker)" ]]; then + echo "Updating docker user uid/gid to $HOST_UID/$HOST_GID to match the host user uid/gid..." + sudo groupmod -g "$HOST_GID" -o users + sudo usermod -u "$HOST_UID" -g "$HOST_GID" -o docker + # Make sure permissions are correct after the uid/gid change + sudo chown "$HOST_UID:$HOST_GID" -R ${HOME_DIR} + sudo chown "$HOST_UID:$HOST_GID" /var/www + fi +fi # Enable xdebug if [[ "${XDEBUG_ENABLED}" == "1" ]]; then @@ -39,4 +48,8 @@ if [[ "${XDEBUG_ENABLED}" == "1" ]]; then fi # Execute passed CMD arguments -exec "$@" +if [[ "$1" == "supervisord" ]]; then + gosu root supervisord +else + gosu docker "$@" +fi From 0be4dbaca26d668459553275add8cbaf7c4a567d Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Mon, 20 Mar 2017 22:20:51 -0700 Subject: [PATCH 5/7] Silence output from startup.sh in command mode --- startup.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/startup.sh b/startup.sh index 61a41450..2ac3fa9f 100755 --- a/startup.sh +++ b/startup.sh @@ -2,13 +2,21 @@ HOME_DIR='/home/docker' +DEBUG=${DEBUG:-0} +# Turn debugging ON when cli is started in the service mode +[[ "$1" == "supervisord" ]] && DEBUG=1 +echo-debug () +{ + [[ "$DEBUG" != 0 ]] && echo "$@" +} + # Copy Acquia Cloud API credentials # @param $1 path to the home directory (parent of the .acquia directory) copy_dot_acquia () { local path="${1}/.acquia/cloudapi.conf" if [[ -f ${path} ]]; then - echo "Copying Acquia Cloud API settings in ${path} from host..." + echo-debug "Copying Acquia Cloud API settings in ${path} from host..." mkdir -p ${HOME_DIR}/.acquia cp ${path} ${HOME_DIR}/.acquia fi @@ -20,7 +28,7 @@ copy_dot_drush () { local path="${1}/.drush" if [[ -d ${path} ]]; then - echo "Copying Drush settigns in ${path} from host..." + echo-debug "Copying Drush settigns in ${path} from host..." cp -r ${path} ${HOME_DIR} fi } @@ -32,7 +40,7 @@ copy_dot_drush '/.home' # Generic ## Docker user uid/gid mapping to the host user uid/gid if [[ "$HOST_UID" != "" ]] && [[ "$HOST_GID" != "" ]]; then if [[ "$HOST_UID" != "$(id -u docker)" ]] || [[ "$HOST_GID" != "$(id -g docker)" ]]; then - echo "Updating docker user uid/gid to $HOST_UID/$HOST_GID to match the host user uid/gid..." + echo-debug "Updating docker user uid/gid to $HOST_UID/$HOST_GID to match the host user uid/gid..." sudo groupmod -g "$HOST_GID" -o users sudo usermod -u "$HOST_UID" -g "$HOST_GID" -o docker # Make sure permissions are correct after the uid/gid change @@ -43,13 +51,15 @@ fi # Enable xdebug if [[ "${XDEBUG_ENABLED}" == "1" ]]; then - echo "Enabling xdebug..." + echo-debug "Enabling xdebug..." sudo php5enmod xdebug fi # Execute passed CMD arguments +# Service mode (run as root) if [[ "$1" == "supervisord" ]]; then gosu root supervisord +# Command mode (run as docker user) else gosu docker "$@" fi From 3352cb7e38ae37575e1f16ac5bf3d9db4df08151 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Mon, 20 Mar 2017 23:08:04 -0700 Subject: [PATCH 6/7] Silence usedmod/groupmod output in startup.sh --- Dockerfile | 6 +++--- startup.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c018e3b..57f80907 100644 --- a/Dockerfile +++ b/Dockerfile @@ -240,12 +240,12 @@ COPY config/.ssh $HOME/.ssh COPY config/.drush $HOME/.drush COPY config/.zpreztorc $HOME/.zpreztorc COPY config/.docksalrc $HOME/.docksalrc -COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf -COPY startup.sh /opt/startup.sh - # Fix permissions after copy RUN sudo chown -R $(id -u docker):$(id -g docker) $HOME +COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY startup.sh /opt/startup.sh + EXPOSE 9000 EXPOSE 22 diff --git a/startup.sh b/startup.sh index 2ac3fa9f..f8357b2c 100755 --- a/startup.sh +++ b/startup.sh @@ -41,8 +41,8 @@ copy_dot_drush '/.home' # Generic if [[ "$HOST_UID" != "" ]] && [[ "$HOST_GID" != "" ]]; then if [[ "$HOST_UID" != "$(id -u docker)" ]] || [[ "$HOST_GID" != "$(id -g docker)" ]]; then echo-debug "Updating docker user uid/gid to $HOST_UID/$HOST_GID to match the host user uid/gid..." - sudo groupmod -g "$HOST_GID" -o users - sudo usermod -u "$HOST_UID" -g "$HOST_GID" -o docker + sudo usermod -u "$HOST_UID" -o docker >/dev/null 2>&1 + sudo groupmod -g "$HOST_GID" -o users >/dev/null 2>&1 # Make sure permissions are correct after the uid/gid change sudo chown "$HOST_UID:$HOST_GID" -R ${HOME_DIR} sudo chown "$HOST_UID:$HOST_GID" /var/www From cadd0e51f11a48f902fb10ca49c1db87a68f6b68 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Tue, 17 May 2016 23:29:06 -0400 Subject: [PATCH 7/7] PHP7 support --- Dockerfile | 111 +++++++++++++++++++++------------------- config/supervisord.conf | 2 +- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/Dockerfile b/Dockerfile index 57f80907..d0875dd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,28 +78,34 @@ RUN mkdir /var/run/sshd & \ echo "export VISIBLE=now" >> /etc/profile ENV NOTVISIBLE "in users profile" +# Add Dotdeb PHP7.0 repo +RUN curl -sSL https://www.dotdeb.org/dotdeb.gpg | apt-key add - && \ + echo 'deb https://packages.dotdeb.org jessie all' > /etc/apt/sources.list.d/php7.list && \ + echo 'deb-src https://packages.dotdeb.org jessie all' >> /etc/apt/sources.list.d/php7.list + # PHP packages RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes --no-install-recommends install \ blackfire-php \ php-pear \ - php5-curl \ - php5-cli \ - php5-common \ - php5-fpm \ - php5-gd \ - php5-gnupg \ - php5-imagick \ - php5-intl \ - php5-json \ - php5-ldap \ - php5-mcrypt \ - php5-memcache \ - php5-mysql \ - php5-sqlite \ - php5-ssh2 \ - php5-xdebug \ - php5-xsl \ + php7.0-bcmath \ + php7.0-cli \ + php7.0-common \ + php7.0-curl \ + php7.0-fpm \ + php7.0-gd \ + php7.0-imagick \ + php7.0-intl \ + php7.0-json \ + php7.0-ldap \ + php7.0-mbstring \ + php7.0-mcrypt \ + php7.0-memcache \ + php7.0-mysql \ + php7.0-sqlite3 \ + php7.0-xdebug \ + php7.0-xml \ + php7.0-zip \ # Cleanup && DEBIAN_FRONTEND=noninteractive apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -107,48 +113,49 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ ## PHP settings RUN mkdir -p /var/www/docroot && \ # PHP-FPM settings - ## /etc/php5/fpm/php.ini - sed -i '/memory_limit =/c memory_limit = 256M' /etc/php5/fpm/php.ini && \ - sed -i '/max_execution_time =/c max_execution_time = 300' /etc/php5/fpm/php.ini && \ - sed -i '/upload_max_filesize =/c upload_max_filesize = 500M' /etc/php5/fpm/php.ini && \ - sed -i '/post_max_size =/c post_max_size = 500M' /etc/php5/fpm/php.ini && \ - sed -i '/error_log =/c error_log = \/dev\/stdout' /etc/php5/fpm/php.ini && \ - sed -i '/always_populate_raw_post_data =/c always_populate_raw_post_data = -1' /etc/php5/fpm/php.ini && \ - sed -i '/sendmail_path =/c sendmail_path = /bin/true' /etc/php5/fpm/php.ini && \ - sed -i '/date.timezone =/c date.timezone = UTC' /etc/php5/fpm/php.ini && \ - sed -i '/display_errors =/c display_errors = On' /etc/php5/fpm/php.ini && \ - sed -i '/display_startup_errors =/c display_startup_errors = On' /etc/php5/fpm/php.ini && \ - ## /etc/php5/fpm/pool.d/www.conf - sed -i '/user =/c user = docker' /etc/php5/fpm/pool.d/www.conf && \ - sed -i '/catch_workers_output =/c catch_workers_output = yes' /etc/php5/fpm/pool.d/www.conf && \ - sed -i '/listen =/c listen = 0.0.0.0:9000' /etc/php5/fpm/pool.d/www.conf && \ - sed -i '/listen.allowed_clients/c ;listen.allowed_clients =' /etc/php5/fpm/pool.d/www.conf && \ - sed -i '/clear_env =/c clear_env = no' /etc/php5/fpm/pool.d/www.conf && \ - ## /etc/php5/fpm/php-fpm.conf - sed -i '/daemonize =/c daemonize = no' /etc/php5/fpm/php-fpm.conf && \ - sed -i '/error_log =/c error_log = \/dev\/stdout' /etc/php5/fpm/php-fpm.conf && \ + ## /etc/php/7.0/fpm/php.ini + sed -i '/memory_limit =/c memory_limit = 256M' /etc/php/7.0/fpm/php.ini && \ + sed -i '/max_execution_time =/c max_execution_time = 300' /etc/php/7.0/fpm/php.ini && \ + sed -i '/upload_max_filesize =/c upload_max_filesize = 500M' /etc/php/7.0/fpm/php.ini && \ + sed -i '/post_max_size =/c post_max_size = 500M' /etc/php/7.0/fpm/php.ini && \ + sed -i '/error_log =/c error_log = \/dev\/stdout' /etc/php/7.0/fpm/php.ini && \ + sed -i '/always_populate_raw_post_data =/c always_populate_raw_post_data = -1' /etc/php/7.0/fpm/php.ini && \ + sed -i '/sendmail_path =/c sendmail_path = /bin/true' /etc/php/7.0/fpm/php.ini && \ + sed -i '/date.timezone =/c date.timezone = UTC' /etc/php/7.0/fpm/php.ini && \ + sed -i '/display_errors =/c display_errors = On' /etc/php/7.0/fpm/php.ini && \ + sed -i '/display_startup_errors =/c display_startup_errors = On' /etc/php/7.0/fpm/php.ini && \ + ## /etc/php/7.0/fpm/pool.d/www.conf + sed -i '/user =/c user = docker' /etc/php/7.0/fpm/pool.d/www.conf && \ + sed -i '/catch_workers_output =/c catch_workers_output = yes' /etc/php/7.0/fpm/pool.d/www.conf && \ + sed -i '/listen =/c listen = 0.0.0.0:9000' /etc/php/7.0/fpm/pool.d/www.conf && \ + sed -i '/listen.allowed_clients/c ;listen.allowed_clients =' /etc/php/7.0/fpm/pool.d/www.conf && \ + sed -i '/clear_env =/c clear_env = no' /etc/php/7.0/fpm/pool.d/www.conf && \ + ## /etc/php/7.0/fpm/php-fpm.conf + sed -i '/daemonize =/c daemonize = no' /etc/php/7.0/fpm/php-fpm.conf && \ + sed -i '/error_log =/c error_log = \/dev\/stdout' /etc/php/7.0/fpm/php-fpm.conf && \ + sed -i '/pid =/c pid = \/run\/php-fpm7.0.pid' /etc/php/7.0/fpm/php-fpm.conf && \ # PHP CLI settings - ## /etc/php5/cli/php.ini - sed -i '/memory_limit =/c memory_limit = 512M' /etc/php5/cli/php.ini && \ - sed -i '/max_execution_time =/c max_execution_time = 600' /etc/php5/cli/php.ini && \ - sed -i '/error_log =/c error_log = \/dev\/stdout' /etc/php5/cli/php.ini && \ - sed -i '/always_populate_raw_post_data/c always_populate_raw_post_data = -1' /etc/php5/cli/php.ini && \ - sed -i '/sendmail_path/c sendmail_path = /bin/true' /etc/php5/cli/php.ini && \ - sed -i '/date.timezone/c date.timezone = UTC' /etc/php5/cli/php.ini && \ - sed -i '/display_errors =/c display_errors = On' /etc/php5/cli/php.ini && \ - sed -i '/display_startup_errors =/c display_startup_errors = On' /etc/php5/cli/php.ini && \ + ## /etc/php/7.0/cli/php.ini + sed -i '/memory_limit =/c memory_limit = 512M' /etc/php/7.0/cli/php.ini && \ + sed -i '/max_execution_time =/c max_execution_time = 600' /etc/php/7.0/cli/php.ini && \ + sed -i '/error_log =/c error_log = \/dev\/stdout' /etc/php/7.0/cli/php.ini && \ + sed -i '/always_populate_raw_post_data/c always_populate_raw_post_data = -1' /etc/php/7.0/cli/php.ini && \ + sed -i '/sendmail_path/c sendmail_path = /bin/true' /etc/php/7.0/cli/php.ini && \ + sed -i '/date.timezone/c date.timezone = UTC' /etc/php/7.0/cli/php.ini && \ + sed -i '/display_errors =/c display_errors = On' /etc/php/7.0/cli/php.ini && \ + sed -i '/display_startup_errors =/c display_startup_errors = On' /etc/php/7.0/cli/php.ini && \ # PHP module settings - echo 'opcache.memory_consumption = 128' >> /etc/php5/mods-available/opcache.ini && \ - sed -i '/blackfire.agent_socket = /c blackfire.agent_socket = tcp://blackfire:8707' /etc/php5/mods-available/blackfire.ini && \ + echo 'opcache.memory_consumption = 128' >> /etc/php/7.0/mods-available/opcache.ini && \ + sed -i '/blackfire.agent_socket = /c blackfire.agent_socket = tcp://blackfire:8707' /etc/php/7.0/mods-available/blackfire.ini && \ # Disable xdebug by default. We will enabled it at startup (see startup.sh) - php5dismod xdebug && \ + phpdismod xdebug && \ # Create symlinks to project level overrides (if the source files are missing, nothing will break) - ln -s /var/www/.docksal/etc/php/php.ini /etc/php5/fpm/conf.d/99-overrides.ini && \ - ln -s /var/www/.docksal/etc/php/php-cli.ini /etc/php5/cli/conf.d/99-overrides.ini + ln -s /var/www/.docksal/etc/php/php.ini /etc/php/7.0/fpm/conf.d/99-overrides.ini && \ + ln -s /var/www/.docksal/etc/php/php-cli.ini /etc/php/7.0/cli/conf.d/99-overrides.ini # xdebug settings ENV XDEBUG_ENABLED 0 -COPY config/php/xdebug.ini /etc/php5/mods-available/xdebug.ini +COPY config/php/xdebug.ini /etc/php/7.0/mods-available/xdebug.ini # Other language packages and dependencies RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ diff --git a/config/supervisord.conf b/config/supervisord.conf index e635d444..ce7cc98e 100644 --- a/config/supervisord.conf +++ b/config/supervisord.conf @@ -3,7 +3,7 @@ nodaemon=true loglevel=debug [program:php-fpm] -command=/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/php-fpm.conf +command=/usr/sbin/php-fpm7.0 --fpm-config /etc/php/7.0/fpm/php-fpm.conf stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr