Skip to content

Commit 5d385f2

Browse files
authored
Add php 8.4 to the list of runtimes (#740)
* Add php 8.4 to the list of runtimes * Add php 8.4 to the docker test matrix
1 parent 601480d commit 5d385f2

File tree

6 files changed

+120
-0
lines changed

6 files changed

+120
-0
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
laravel: 11
2727
- php: '8.3'
2828
laravel: 11
29+
- php: '8.4'
30+
laravel: 11
2931

3032
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
3133

runtimes/8.4/Dockerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
FROM ubuntu:22.04
2+
3+
LABEL maintainer="Taylor Otwell"
4+
5+
ARG WWWGROUP
6+
ARG NODE_VERSION=20
7+
ARG MYSQL_CLIENT="mysql-client"
8+
ARG POSTGRES_VERSION=17
9+
10+
WORKDIR /var/www/html
11+
12+
ENV DEBIAN_FRONTEND noninteractive
13+
ENV TZ=UTC
14+
ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80"
15+
ENV SUPERVISOR_PHP_USER="sail"
16+
17+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
18+
19+
RUN echo "Acquire::http::Pipeline-Depth 0;" > /etc/apt/apt.conf.d/99custom && \
20+
echo "Acquire::http::No-Cache true;" >> /etc/apt/apt.conf.d/99custom && \
21+
echo "Acquire::BrokenProxy true;" >> /etc/apt/apt.conf.d/99custom
22+
23+
RUN apt-get update && apt-get upgrade -y \
24+
&& mkdir -p /etc/apt/keyrings \
25+
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch ffmpeg nano \
26+
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
27+
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
28+
&& apt-get update \
29+
&& apt-get install -y php8.4-cli php8.4-dev \
30+
php8.4-pgsql php8.4-sqlite3 php8.4-gd \
31+
php8.4-curl \
32+
php8.4-imap php8.4-mysql php8.4-mbstring \
33+
php8.4-xml php8.4-zip php8.4-bcmath php8.4-soap \
34+
php8.4-intl php8.4-readline \
35+
php8.4-ldap \
36+
php8.4-msgpack php8.4-igbinary php8.4-redis \
37+
# php8.4-swoole \
38+
php8.4-memcached php8.4-pcov php8.4-imagick php8.4-xdebug \
39+
&& curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
40+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
41+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
42+
&& apt-get update \
43+
&& apt-get install -y nodejs \
44+
&& npm install -g npm \
45+
&& npm install -g pnpm \
46+
&& npm install -g bun \
47+
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \
48+
&& echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
49+
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
50+
&& echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
51+
&& apt-get update \
52+
&& apt-get install -y yarn \
53+
&& apt-get install -y $MYSQL_CLIENT \
54+
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
55+
&& apt-get -y autoremove \
56+
&& apt-get clean \
57+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
58+
59+
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.4
60+
61+
RUN groupadd --force -g $WWWGROUP sail
62+
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
63+
64+
COPY start-container /usr/local/bin/start-container
65+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
66+
COPY php.ini /etc/php/8.4/cli/conf.d/99-sail.ini
67+
RUN chmod +x /usr/local/bin/start-container
68+
69+
EXPOSE 80/tcp
70+
71+
ENTRYPOINT ["start-container"]

runtimes/8.4/php.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[PHP]
2+
post_max_size = 100M
3+
upload_max_filesize = 100M
4+
variables_order = EGPCS
5+
pcov.directory = .

runtimes/8.4/start-container

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$SUPERVISOR_PHP_USER" != "root" ] && [ "$SUPERVISOR_PHP_USER" != "sail" ]; then
4+
echo "You should set SUPERVISOR_PHP_USER to either 'sail' or 'root'."
5+
exit 1
6+
fi
7+
8+
if [ ! -z "$WWWUSER" ]; then
9+
usermod -u $WWWUSER sail
10+
fi
11+
12+
if [ ! -d /.composer ]; then
13+
mkdir /.composer
14+
fi
15+
16+
chmod -R ugo+rw /.composer
17+
18+
if [ $# -gt 0 ]; then
19+
if [ "$SUPERVISOR_PHP_USER" = "root" ]; then
20+
exec "$@"
21+
else
22+
exec gosu $WWWUSER "$@"
23+
fi
24+
else
25+
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
26+
fi

runtimes/8.4/supervisord.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[supervisord]
2+
nodaemon=true
3+
user=root
4+
logfile=/var/log/supervisor/supervisord.log
5+
pidfile=/var/run/supervisord.pid
6+
7+
[program:php]
8+
command=%(ENV_SUPERVISOR_PHP_COMMAND)s
9+
user=%(ENV_SUPERVISOR_PHP_USER)s
10+
environment=LARAVEL_SAIL="1"
11+
stdout_logfile=/dev/stdout
12+
stdout_logfile_maxbytes=0
13+
stderr_logfile=/dev/stderr
14+
stderr_logfile_maxbytes=0

src/Console/PublishCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function handle()
3636
$this->laravel->basePath('docker-compose.yml'),
3737
str_replace(
3838
[
39+
'./vendor/laravel/sail/runtimes/8.4',
3940
'./vendor/laravel/sail/runtimes/8.3',
4041
'./vendor/laravel/sail/runtimes/8.2',
4142
'./vendor/laravel/sail/runtimes/8.1',
@@ -44,6 +45,7 @@ public function handle()
4445
'./vendor/laravel/sail/database/pgsql'
4546
],
4647
[
48+
'./docker/8.4',
4749
'./docker/8.3',
4850
'./docker/8.2',
4951
'./docker/8.1',

0 commit comments

Comments
 (0)