From 16015ab56a7e63543de0352de626e6ae0e3517e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 17:02:52 +0100 Subject: [PATCH 1/9] BaseImage PHP8 --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 1a2fba34..2378a7d6 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ -FROM gitpod/workspace-mysql +FROM gitpod/workspace-mysql:latest USER gitpod From e8a7240d69c7ed30aa720454c2aff3d00e58e8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 17:21:21 +0100 Subject: [PATCH 2/9] Update to PHP 8.0 --- .gitpod.Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 2378a7d6..af612aea 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -11,22 +11,22 @@ RUN sudo touch /var/log/workspace-image.log \ RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections \ && sudo apt-get update -q \ - && sudo apt-get -y install php7.4-fpm rsync grc shellcheck apt-transport-https ca-certificates \ + && sudo apt-get -y install php8.0-fpm rsync grc shellcheck apt-transport-https ca-certificates \ && sudo apt-get clean \ && sudo update-ca-certificates COPY --chown=gitpod:gitpod .gp/conf/xdebug/xdebug.ini /tmp -RUN wget http://xdebug.org/files/xdebug-3.0.4.tgz \ - && tar -xvzf xdebug-3.0.4.tgz \ - && cd xdebug-3.0.4 \ +RUN wget http://xdebug.org/files/xdebug-3.1.1.tgz \ + && tar -xvzf xdebug-3.1.1.tgz \ + && cd xdebug-3.1.1 \ && phpize \ && ./configure --enable-xdebug \ && make \ - && sudo cp modules/xdebug.so /usr/lib/php/20190902/xdebug.so \ - && sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20190902/xdebug.so\n[XDebug]\nxdebug.client_host = 127.0.0.1\nxdebug.client_port = 9009\nxdebug.log = /var/log/xdebug.log\nxdebug.mode = debug\nxdebug.start_with_request = trigger\n' >> /etc/php/7.4/cli/conf.d/20-xdebug.ini" \ - && sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20190902/xdebug.so\n[XDebug]\nxdebug.client_host = 127.0.0.1\nxdebug.client_port = 9009\nxdebug.log = /var/log/xdebug.log\nxdebug.mode = debug\nxdebug.start_with_request = trigger\n' >> /etc/php/7.4/apache2/conf.d/20-xdebug.ini" \ + && sudo cp modules/xdebug.so /usr/lib/php/20200930/xdebug.so \ + && sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20200930/xdebug.so\n[XDebug]\nxdebug.client_host = 127.0.0.1\nxdebug.client_port = 9009\nxdebug.log = /var/log/xdebug.log\nxdebug.mode = debug\nxdebug.start_with_request = trigger\n' >> /etc/php/8.0/cli/conf.d/20-xdebug.ini" \ + && sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20200930/xdebug.so\n[XDebug]\nxdebug.client_host = 127.0.0.1\nxdebug.client_port = 9009\nxdebug.log = /var/log/xdebug.log\nxdebug.mode = debug\nxdebug.start_with_request = trigger\n' >> /etc/php/8.0/apache2/conf.d/20-xdebug.ini" \ && sudo cp /tmp/xdebug.ini /etc/php/7.4/mods-available/20-xdebug.ini \ - && sudo ln -s /etc/php/7.4/mods-available/20-xdebug.ini /etc/php/7.4/fpm/conf.d + && sudo ln -s /etc/php/8.0/mods-available/20-xdebug.ini /etc/php/8.0/fpm/conf.d COPY --chown=gitpod:gitpod .gp/bash/update-composer.sh /tmp RUN sudo bash -c ". /tmp/update-composer.sh" && rm /tmp/update-composer.sh From 29223dfc22bf0d94368b5b9b3bb0a12bd4a053b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 17:24:05 +0100 Subject: [PATCH 3/9] Update .gitpod.Dockerfile --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index af612aea..63a9de84 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -25,7 +25,7 @@ RUN wget http://xdebug.org/files/xdebug-3.1.1.tgz \ && sudo cp modules/xdebug.so /usr/lib/php/20200930/xdebug.so \ && sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20200930/xdebug.so\n[XDebug]\nxdebug.client_host = 127.0.0.1\nxdebug.client_port = 9009\nxdebug.log = /var/log/xdebug.log\nxdebug.mode = debug\nxdebug.start_with_request = trigger\n' >> /etc/php/8.0/cli/conf.d/20-xdebug.ini" \ && sudo bash -c "echo -e '\nzend_extension = /usr/lib/php/20200930/xdebug.so\n[XDebug]\nxdebug.client_host = 127.0.0.1\nxdebug.client_port = 9009\nxdebug.log = /var/log/xdebug.log\nxdebug.mode = debug\nxdebug.start_with_request = trigger\n' >> /etc/php/8.0/apache2/conf.d/20-xdebug.ini" \ - && sudo cp /tmp/xdebug.ini /etc/php/7.4/mods-available/20-xdebug.ini \ + && sudo cp /tmp/xdebug.ini /etc/php/8.0/mods-available/20-xdebug.ini \ && sudo ln -s /etc/php/8.0/mods-available/20-xdebug.ini /etc/php/8.0/fpm/conf.d COPY --chown=gitpod:gitpod .gp/bash/update-composer.sh /tmp From 6956840642cc7636de4f488065e4e704e3c384f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 17:31:14 +0100 Subject: [PATCH 4/9] Update to PHP 8.0 Fix #155 --- .gp/snippets/server-functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gp/snippets/server-functions.sh b/.gp/snippets/server-functions.sh index ba880011..82b7d7e6 100644 --- a/.gp/snippets/server-functions.sh +++ b/.gp/snippets/server-functions.sh @@ -68,7 +68,7 @@ stop_apache() { } start_nginx() { - nginx & /usr/sbin/php-fpm7.4 --fpm-config .gp/conf/php-fpm/php-fpm.conf + nginx & /usr/sbin/php-fpm8.0 --fpm-config .gp/conf/php-fpm/php-fpm.conf local exit_code=$? (( exit_code == 0 )) || return local log_monitor_type= @@ -88,7 +88,7 @@ start_nginx() { } stop_nginx() { - nginx -s stop && pkill php-fpm7.4 + nginx -s stop && pkill php-fpm8.0 local exit_code=$? (( exit_code == 0 )) || return local pid From 2bff41bf814e21d81b90c994ceabddd20607a0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 17:43:08 +0100 Subject: [PATCH 5/9] Fix PHP8 Path --- .gp/conf/php-fpm/php-fpm.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gp/conf/php-fpm/php-fpm.conf b/.gp/conf/php-fpm/php-fpm.conf index 4ab375ee..a1ce4bd5 100644 --- a/.gp/conf/php-fpm/php-fpm.conf +++ b/.gp/conf/php-fpm/php-fpm.conf @@ -1,6 +1,6 @@ [global] -pid = /tmp/php7.4-fpm.pid -error_log = /tmp/php7.4-fpm.log +pid = /tmp/php8.0-fpm.pid +error_log = /tmp/php8.0-fpm.log [www] listen = 127.0.0.1:9000 @@ -11,4 +11,4 @@ pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 -pm.max_spare_servers = 3 \ No newline at end of file +pm.max_spare_servers = 3 From bc8ea48364378bdb95e0a3face9586ac5fca5f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 17:43:46 +0100 Subject: [PATCH 6/9] Fix PHP 8 Path --- .gp/conf/xdebug/xdebug.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gp/conf/xdebug/xdebug.ini b/.gp/conf/xdebug/xdebug.ini index 8aec5485..897d4e28 100644 --- a/.gp/conf/xdebug/xdebug.ini +++ b/.gp/conf/xdebug/xdebug.ini @@ -1,6 +1,6 @@ -zend_extension=/usr/lib/php/20190902/xdebug.so +zend_extension=/usr/lib/php/20200930/xdebug.so xdebug.client_host = 127.0.0.1 xdebug.client_port = 9009 xdebug.log = /var/log/xdebug.log xdebug.mode = debug -xdebug.start_with_request = trigger \ No newline at end of file +xdebug.start_with_request = trigger From 79732dd3b92ecc0fe1b3d1d0191cbb9adde82078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 18:06:03 +0100 Subject: [PATCH 7/9] Clear APT lists --- .gitpod.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 63a9de84..75fd10eb 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -13,7 +13,8 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-sel && sudo apt-get update -q \ && sudo apt-get -y install php8.0-fpm rsync grc shellcheck apt-transport-https ca-certificates \ && sudo apt-get clean \ - && sudo update-ca-certificates + && sudo update-ca-certificates \ + && sudo rm -rf /var/lib/apt/lists/* COPY --chown=gitpod:gitpod .gp/conf/xdebug/xdebug.ini /tmp RUN wget http://xdebug.org/files/xdebug-3.1.1.tgz \ From f60494ae56e2f474cc5a8126e7323b25b85fecc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 18:10:21 +0100 Subject: [PATCH 8/9] Add Workspace/Project composer bin folder to $PATH --- .gp/bash/init-complete.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gp/bash/init-complete.sh b/.gp/bash/init-complete.sh index 83747734..c1075a7b 100644 --- a/.gp/bash/init-complete.sh +++ b/.gp/bash/init-complete.sh @@ -31,3 +31,6 @@ bash .gp/bash/helpers.sh persist_file /var/log/workspace-init.log # Set initialized flag - Keep this at the bottom of the file bash .gp/bash/helpers.sh mark_as_inited gp sync-done gitpod-inited + +# Add Workspace/Project composer bin folder to $PATH +export PATH="$PATH:$HOME/.config/composer/vendor/bin:$GITPOD_REPO_ROOT/vendor/bin" From 85fea8ad68d18fd0014c9df0a9c32c6cd85774df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Fri, 12 Nov 2021 18:10:49 +0100 Subject: [PATCH 9/9] Add Workspace/Project composer bin folder to $PATH --- .gitpod.Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 75fd10eb..648b6863 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -53,6 +53,3 @@ RUN cp /tmp/server-functions.sh ~/.bashrc.d/server-functions \ # Customs cli's and user scripts for /usr/local/bin COPY --chown=gitpod:gitpod .gp/bash/bin/hot-reload.sh /usr/local/bin RUN sudo mv /usr/local/bin/hot-reload.sh /usr/local/bin/hot-reload - -# Add global composer bin folder to $PATH -ENV PATH="$PATH:$HOME/.config/composer/vendor/bin:$GITPOD_REPO_ROOT/vendor/bin"