Skip to content

Commit 3d5d29e

Browse files
authored
[php] Laravel update to v 11 (#9200)
* Update Laravel to v 11 * Update and clean dockerfiles * Fix pecl * Update dockerfile and remove extra composer.json * Clean dockerfile
1 parent 2e05f43 commit 3d5d29e

File tree

9 files changed

+54
-97
lines changed

9 files changed

+54
-97
lines changed

frameworks/PHP/laravel/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"license": "MIT",
1010
"require": {
11-
"laravel/framework": "^10"
11+
"laravel/framework": "^11"
1212
},
1313
"config": {
1414
"optimize-autoloader": true,

frameworks/PHP/laravel/deploy/conf/php.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1767,7 +1767,7 @@ ldap.max_links = -1
17671767
opcache.enable=1
17681768

17691769
; Determines if Zend OPCache is enabled for the CLI version of PHP
1770-
;opcache.enable_cli=0
1770+
opcache.enable_cli=1
17711771

17721772
; The OPcache shared memory storage size.
17731773
;opcache.memory_consumption=128

frameworks/PHP/laravel/deploy/workerman/composer.json

Lines changed: 0 additions & 58 deletions
This file was deleted.

frameworks/PHP/laravel/laravel-laravel-s.dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ RUN echo "opcache.jit_buffer_size=128M" >> /usr/local/etc/php/conf.d/docker-php-
99
WORKDIR /laravel
1010
COPY --link . .
1111

12-
RUN mkdir -p /laravel/bootstrap/cache /laravel/storage/logs /laravel/storage/framework/sessions /laravel/storage/framework/views /laravel/storage/framework/cache
12+
RUN mkdir -p bootstrap/cache \
13+
storage/logs \
14+
storage/framework/sessions \
15+
storage/framework/views \
16+
storage/framework/cache
1317

1418
COPY --link deploy/laravel-s/composer.json .
1519

frameworks/PHP/laravel/laravel-octane-frankenphp.dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
FROM dunglas/frankenphp
22

33
RUN install-php-extensions \
4-
pcntl \
4+
intl \
5+
opcache \
6+
pcntl \
57
pdo_mysql \
6-
intl \
7-
zip \
8-
opcache > /dev/null
8+
zip > /dev/null
99

10-
COPY . /app
10+
COPY --link . /app/
1111

12-
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
COPY --from=composer --link /usr/bin/composer /usr/local/bin/composer
1313

14-
RUN mkdir -p /app/bootstrap/cache /app/storage/logs /app/storage/framework/sessions /app/storage/framework/views /app/storage/framework/cache
15-
RUN chmod -R 777 /app
14+
RUN mkdir -p bootstrap/cache \
15+
storage/logs \
16+
storage/framework/sessions \
17+
storage/framework/views \
18+
storage/framework/cache
1619

17-
COPY deploy/conf/php.ini /usr/local/etc/php
18-
19-
RUN composer require laravel/octane guzzlehttp/guzzle
20-
21-
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
20+
COPY --link deploy/conf/php.ini /usr/local/etc/php
2221

22+
RUN composer require laravel/octane guzzlehttp/guzzle --update-no-dev --no-scripts --quiet
2323
RUN php artisan optimize
2424

2525
RUN frankenphp -v

frameworks/PHP/laravel/laravel-roadrunner.dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/conf.d/docker-php-ext-opca
99
WORKDIR /laravel
1010
COPY --link . .
1111

12-
RUN mkdir -p /laravel/bootstrap/cache /laravel/storage/logs /laravel/storage/framework/sessions /laravel/storage/framework/views /laravel/storage/framework/cache
12+
RUN mkdir -p bootstrap/cache \
13+
storage/logs \
14+
storage/framework/sessions \
15+
storage/framework/views \
16+
storage/framework/cache
1317

1418
RUN apt-get update > /dev/null && \
1519
apt-get install -yqq curl unzip > /dev/null

frameworks/PHP/laravel/laravel-swoole.dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ RUN echo "opcache.jit_buffer_size=128M" >> /usr/local/etc/php/conf.d/docker-php-
99
WORKDIR /laravel
1010
COPY --link . .
1111

12-
RUN mkdir -p /laravel/bootstrap/cache /laravel/storage/framework/sessions /laravel/storage/framework/views /laravel/storage/framework/cache
12+
RUN mkdir -p bootstrap/cache \
13+
storage/logs \
14+
storage/framework/sessions \
15+
storage/framework/views \
16+
storage/framework/cache
1317

1418
COPY --link deploy/swoole/composer.json .
1519

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

@@ -9,23 +9,25 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
99
RUN apt-get install -yqq git unzip \
1010
php8.3-cli php8.3-mysql php8.3-mbstring php8.3-xml php8.3-curl > /dev/null
1111

12-
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
COPY --from=composer --link /usr/bin/composer /usr/local/bin/composer
1313

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

17-
ADD ./ /laravel
1817
WORKDIR /laravel
18+
COPY --link . .
1919

20-
EXPOSE 8080
21-
22-
RUN mkdir -p /laravel/bootstrap/cache /laravel/storage/logs /laravel/storage/framework/sessions /laravel/storage/framework/views /laravel/storage/framework/cache
23-
RUN chmod -R 777 /laravel
20+
RUN mkdir -p bootstrap/cache \
21+
storage/logs \
22+
storage/framework/sessions \
23+
storage/framework/views \
24+
storage/framework/cache
2425

25-
COPY deploy/workerman/composer.json ./
26-
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
26+
RUN composer require joanhey/adapterman --update-no-dev --no-scripts --quiet
2727
RUN php artisan optimize
2828

29-
COPY deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini
29+
COPY --link deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini
30+
31+
EXPOSE 8080
3032

31-
CMD php server-man.php start
33+
ENTRYPOINT [ "php", "server-man.php", "start" ]
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

@@ -7,19 +7,21 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
77
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null
88

99
RUN apt-get install -yqq nginx git unzip \
10-
php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-xml php8.3-dev > /dev/null
10+
php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-xml php8.3-curl > /dev/null
1111

12-
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
COPY --from=composer --link /usr/bin/composer /usr/local/bin/composer
1313

14-
COPY deploy/conf/* /etc/php/8.3/fpm/
15-
16-
ADD ./ /laravel
14+
COPY --link deploy/conf/* /etc/php/8.3/fpm/
1715
WORKDIR /laravel
16+
COPY --link . .
1817

1918
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;
2019

21-
RUN mkdir -p /laravel/bootstrap/cache /laravel/storage/logs /laravel/storage/framework/sessions /laravel/storage/framework/views /laravel/storage/framework/cache
22-
RUN chmod -R 777 /laravel
20+
RUN mkdir -p bootstrap/cache \
21+
storage/logs \
22+
storage/framework/sessions \
23+
storage/framework/views \
24+
storage/framework/cache
2325

2426
RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
2527
RUN php artisan optimize
@@ -29,6 +31,5 @@ EXPOSE 8080
2931
# Uncomment next line for Laravel console error logging to be viewable in docker logs
3032
# RUN echo "catch_workers_output = yes" >> /etc/php/8.3/fpm/php-fpm.conf
3133

32-
RUN mkdir -p /run/php
33-
CMD /usr/sbin/php-fpm8.3 --fpm-config /etc/php/8.3/fpm/php-fpm.conf && \
34+
CMD service php8.3-fpm start && \
3435
nginx -c /laravel/deploy/nginx.conf

0 commit comments

Comments
 (0)