Skip to content

Commit

Permalink
Merge pull request #2 from strausmann/php8
Browse files Browse the repository at this point in the history
Fix Issue #155
  • Loading branch information
strausmann authored Nov 12, 2021
2 parents d43b0c8 + 85fea8a commit 49d2f6c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
26 changes: 12 additions & 14 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gitpod/workspace-mysql
FROM gitpod/workspace-mysql:latest

USER gitpod

Expand All @@ -11,22 +11,23 @@ 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
&& 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.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 /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 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/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
RUN sudo bash -c ". /tmp/update-composer.sh" && rm /tmp/update-composer.sh
Expand All @@ -52,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"
3 changes: 3 additions & 0 deletions .gp/bash/init-complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions .gp/conf/php-fpm/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -11,4 +11,4 @@ pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_spare_servers = 3
4 changes: 2 additions & 2 deletions .gp/conf/xdebug/xdebug.ini
Original file line number Diff line number Diff line change
@@ -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
xdebug.start_with_request = trigger
4 changes: 2 additions & 2 deletions .gp/snippets/server-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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
Expand Down

0 comments on commit 49d2f6c

Please sign in to comment.