Skip to content

Commit

Permalink
Upgrade to PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Nov 1, 2023
1 parent 23e196e commit f052e41
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
39 changes: 28 additions & 11 deletions docker/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
software-properties-common \
gpg-agent

RUN \
# https://launchpad.net/~ondrej/+archive/ubuntu/php
# ubuntu:22.04 only ships with PHP 8.1
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
apt-get update

RUN \
apt-get install -y --no-install-recommends \
ca-certificates \
supervisor \
apache2 \
php8.1 \
php8.1-curl \
php8.1-fpm \
php8.1-intl \
php8.1-mbstring \
php8.1-pgsql \
php8.1-xml \
php8.1-zip \
php8.2 \
php8.2-curl \
php8.2-fpm \
php8.2-intl \
php8.2-mbstring \
php8.2-pgsql \
php8.2-xml \
php8.2-zip \
php-excimer && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -25,11 +35,14 @@ COPY ./docker/backend/apache/gib-potato.conf /etc/apache2/sites-available/gib-po

RUN \
a2ensite gib-potato && \
a2enconf php8.1-fpm && \
a2enconf php8.2-fpm && \
a2enmod proxy_fcgi && \
a2enmod rewrite && \
phpenmod -s fpm excimer && \
sed -i "s/;clear_env = no/clear_env = no/g" /etc/php/8.1/fpm/pool.d/www.conf && \
# Enable zend.assertions
# Development Value: 1
sed -i "s/zend.assertions = -1/zend.assertions = 1/g" /etc/php/8.2/fpm/php.ini && \
sed -i "s/;clear_env = no/clear_env = no/g" /etc/php/8.2/fpm/pool.d/www.conf && \
sed -i "s/Listen 80/Listen 8080/g" /etc/apache2/ports.conf

RUN mkdir -p /run/php/
Expand Down Expand Up @@ -72,6 +85,10 @@ RUN composer install --no-dev

FROM php-local as php-prod

# Disable zend.assertions again
# -1: Do not compile at all
RUN sed -i "s/zend.assertions = 1/zend.assertions = -1/g" /etc/php/8.2/fpm/php.ini

WORKDIR /var/www/gib-potato

COPY ./bin bin
Expand Down
2 changes: 1 addition & 1 deletion docker/backend/apache/gib-potato.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DocumentRoot /var/www/gib-potato/webroot

<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost"
SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
</FilesMatch>

<Directory /var/www/gib-potato/webroot/>
Expand Down
2 changes: 1 addition & 1 deletion docker/backend/supervisord/conf.d/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[program:php-fpm]
command = /usr/sbin/php-fpm8.1 --nodaemonize --fpm-config /etc/php/8.1/fpm/php-fpm.conf
command = /usr/sbin/php-fpm8.2 --nodaemonize --fpm-config /etc/php/8.2/fpm/php-fpm.conf
autostart=true
autorestart=true
priority=5
Expand Down

0 comments on commit f052e41

Please sign in to comment.