Skip to content

[symfony] Fix and update to php 8.1 #6991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions frameworks/PHP/symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"ext-ctype": "*",
"ext-iconv": "*",
"ext-mbstring": "*",
"symfony/console": "5.1.*",
"symfony/dotenv": "5.1.*",
"symfony/flex": "^1.6.0",
"symfony/framework-bundle": "5.1.*",
"symfony/orm-pack": "^1.0",
"symfony/twig-bundle": "5.1.*",
"symfony/yaml": "5.1.*"
"symfony/console": "^6.0",
"symfony/dotenv": "^6.0",
"symfony/flex": "^2.0",
"symfony/framework-bundle": "^6.0",
"symfony/orm-pack": "^2.1",
"symfony/twig-bundle": "^6.0",
"symfony/yaml": "^6.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
1 change: 1 addition & 0 deletions frameworks/PHP/symfony/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
kernel.secret: ThisIsVerySecret!

services:
# default configuration for services in *this* file
Expand Down
18 changes: 9 additions & 9 deletions frameworks/PHP/symfony/symfony.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /de
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq nginx git unzip curl \
php8.0-cli php8.0-fpm php8.0-mysql \
php8.0-mbstring php8.0-xml php8.0-curl > /dev/null
php8.1-cli php8.1-fpm php8.1-mysql \
php8.1-mbstring php8.1-xml php8.1-curl php8.1-dev > /dev/null

RUN curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

COPY deploy/conf/* /etc/php/8.0/fpm/
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.0/fpm/php-fpm.conf ; fi;
COPY deploy/conf/* /etc/php/8.1/fpm/
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.1/fpm/php-fpm.conf ; fi;

WORKDIR /symfony
ADD ./composer.json /symfony/
Expand All @@ -21,19 +21,19 @@ RUN composer install --no-dev --no-scripts

# downgrade to doctrine-dbal 2.12 => due to a bug in version 2.13
# see https://github.com/doctrine/dbal/issues/4603
RUN composer require doctrine/orm:2.8.5 -W
RUN composer require doctrine/dbal:2.12.x -W
#RUN composer require doctrine/orm:2.10.2 -W
#RUN composer require doctrine/dbal:2.12.x -W

ADD . /symfony
RUN COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload --no-dev --classmap-authoritative
RUN COMPOSER_ALLOW_SUPERUSER=1 composer dump-env prod

# removes hardcoded option `ATTR_STATEMENT_CLASS` conflicting with `ATTR_PERSISTENT`. Hack not needed when upgrading to Doctrine 3
# see https://github.com/doctrine/dbal/issues/2315
RUN sed -i '/PDO::ATTR_STATEMENT_CLASS/d' ./vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
#RUN sed -i '/PDO::ATTR_STATEMENT_CLASS/d' ./vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php

RUN php bin/console cache:clear
RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.0/fpm/php.ini
RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.1/fpm/php.ini

CMD service php8.0-fpm start && \
CMD service php8.1-fpm start && \
nginx -c /symfony/deploy/nginx.conf