Skip to content

Commit

Permalink
PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanediondev committed Feb 8, 2025
1 parent 6f0d301 commit 730b6a7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG ALPINE_VERSION=3.20
ARG ALPINE_VERSION=3.21
FROM alpine:${ALPINE_VERSION}
LABEL Maintainer="Tim de Pater <[email protected]>"
LABEL Description="Lightweight container with Nginx 1.22 & PHP 8.2 based on Alpine Linux edge"
LABEL Description="Lightweight container with Nginx 1.26 & PHP 8.4 based on Alpine Linux edge"

ENV APP_ENV=prod
ENV INSTALLATION_TYPE=docker
Expand All @@ -15,13 +15,13 @@ ENV SSL_VERIFY_HOST=$SSL_VERIFY_HOST
ENV SECRET_REGISTER=$SECRET_REGISTER

# Install packages and remove default server definition
RUN apk --no-cache add php82 php82-fpm php82-opcache php82-json php82-openssl php82-curl php82-zlib php82-fileinfo \
php82-xml php82-simplexml php82-phar php82-intl php82-dom php82-xmlreader php82-ctype php82-session php82-gd \
php82-tokenizer php82-pdo php82-pdo_mysql php82-pdo_pgsql php82-iconv php82-zip php82-gmp php82-mbstring php82-xmlwriter \
RUN apk --no-cache add php84 php84-fpm php84-opcache php84-json php84-openssl php84-curl php84-zlib php84-fileinfo \
php84-xml php84-simplexml php84-phar php84-intl php84-dom php84-xmlreader php84-ctype php84-session php84-gd \
php84-tokenizer php84-pdo php84-pdo_mysql php84-pdo_pgsql php84-iconv php84-zip php84-gmp php84-mbstring php84-xmlwriter \
nginx supervisor curl

# Create symlink so programs depending on `php` still function
RUN ln -s /usr/bin/php82 /usr/bin/php
RUN ln -s /usr/bin/php84 /usr/bin/php

# Configure nginx
COPY docker/nginx.conf /etc/nginx/nginx.conf
Expand All @@ -30,8 +30,8 @@ COPY docker/fullchain.pem /etc/nginx/fullchain.pem
RUN rm -f /etc/nginx/conf.d/default.conf

# Configure PHP-FPM
COPY docker/fpm-pool.conf /etc/php82/php-fpm.d/www.conf
COPY docker/php.ini /etc/php82/conf.d/custom.ini
COPY docker/fpm-pool.conf /etc/php84/php-fpm.d/www.conf
COPY docker/php.ini /etc/php84/conf.d/custom.ini

# Configure supervisord
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
Expand All @@ -40,12 +40,12 @@ COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN mkdir -p /var/www/html && mkdir -p /.composer

# Make sure files/folders needed by the processes are accessable when they run under the nobody user
RUN chown -R nobody.nobody /var/www/html && \
chown -R nobody.nobody /.composer && \
chown -R nobody.nobody /etc/nginx && \
chown -R nobody.nobody /run && \
chown -R nobody.nobody /var/lib/nginx && \
chown -R nobody.nobody /var/log/nginx
RUN chown -R nobody:nobody /var/www/html && \
chown -R nobody:nobody /.composer && \
chown -R nobody:nobody /etc/nginx && \
chown -R nobody:nobody /run && \
chown -R nobody:nobody /var/lib/nginx && \
chown -R nobody:nobody /var/log/nginx

# Switch to use a non-root user from here on
USER nobody
Expand Down
2 changes: 1 addition & 1 deletion docker/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logfile_maxbytes=0
pidfile=/run/supervisord.pid

[program:php-fpm]
command=php-fpm82 -F
command=php-fpm84 -F
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/AbstractAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function setTranslator(TranslatorInterface $translator): void
/**
* @param array<mixed> $parameters
*/
public function renderAbstract(Request $request, string $view, array $parameters = [], Response $response = null): Response
public function renderAbstract(Request $request, string $view, array $parameters = [], ?Response $response = null): Response
{
if (false === isset($parameters['firewall'])) {
$parameters['firewall'] = true;
Expand Down

0 comments on commit 730b6a7

Please sign in to comment.