Skip to content

Commit

Permalink
[php] Yii2 update to PHP 8.3 (#8602)
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey authored Nov 29, 2023
1 parent 6fa8000 commit 7c7aae3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion frameworks/PHP/yii2/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"yidas/yii2-composer-bower-skip": "~2.0.13",
"yiisoft/yii2": "~2.0.43",
"yiisoft/yii2": "~2.0.49",
"joanhey/adapterman": "^0.6"
},
"config": {
Expand Down
8 changes: 4 additions & 4 deletions frameworks/PHP/yii2/yii2-raw.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
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 php8.2 php8.2-common php8.2-cli php8.2-fpm php8.2-mysql php8.2-mbstring php8.2-dev > /dev/null
apt-get install -yqq nginx git unzip php8.3 php8.3-common php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-dev > /dev/null

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

COPY deploy/conf/* /etc/php/8.2/fpm/
COPY deploy/conf/* /etc/php/8.3/fpm/

ADD ./ /yii2
WORKDIR /yii2

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

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet

EXPOSE 8080

CMD service php8.2-fpm start && \
CMD service php8.3-fpm start && \
nginx -c /yii2/deploy/nginx.conf
8 changes: 4 additions & 4 deletions frameworks/PHP/yii2/yii2-workerman.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq git php8.2-cli php8.2-mysql php8.2-mbstring php8.2-xml > /dev/null
apt-get install -yqq git php8.3-cli php8.3-mysql php8.3-mbstring php8.3-xml > /dev/null

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

RUN apt-get install -y php-pear php8.2-dev libevent-dev > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini
RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini

COPY deploy/conf/cli-php.ini /etc/php/8.2/cli/php.ini
COPY deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini

ADD ./ /yii2
WORKDIR /yii2
Expand Down
8 changes: 4 additions & 4 deletions frameworks/PHP/yii2/yii2.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
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 php8.2 php8.2-common php8.2-cli php8.2-fpm php8.2-mysql php8.2-mbstring php8.2-dev > /dev/null
apt-get install -yqq nginx git unzip php8.3 php8.3-common php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-dev > /dev/null

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

COPY deploy/conf/* /etc/php/8.2/fpm/
COPY deploy/conf/* /etc/php/8.3/fpm/

ADD ./ /yii2
WORKDIR /yii2

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

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet

EXPOSE 8080

CMD service php8.2-fpm start && \
CMD service php8.3-fpm start && \
nginx -c /yii2/deploy/nginx.conf

0 comments on commit 7c7aae3

Please sign in to comment.