Skip to content

Commit 59ff14a

Browse files
authored
[Chore] Upgraded sail development environment to PHP 8.3 (alexjustesen#1385)
1 parent ff3f616 commit 59ff14a

File tree

8 files changed

+50
-50
lines changed

8 files changed

+50
-50
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Setup PHP
4343
uses: shivammathur/setup-php@v2
4444
with:
45-
php-version: '8.2'
45+
php-version: '8.3'
4646

4747
- name: Prepare the environment
4848
run: cp .env.testing .env

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"config": {
8888
"optimize-autoloader": true,
8989
"platform": {
90-
"php": "8.2"
90+
"php": "8.3"
9191
},
9292
"preferred-install": "dist",
9393
"sort-packages": true,

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ version: '3'
22
services:
33
laravel.test:
44
build:
5-
context: ./docker/8.2
5+
context: ./docker/8.3
66
dockerfile: Dockerfile
77
args:
88
WWWGROUP: '${WWWGROUP}'
9-
image: speedtest-tracker-8.2/app
9+
image: speedtest-tracker-8.3/app
1010
extra_hosts:
1111
- 'host.docker.internal:host-gateway'
1212
ports:

docker/8.2/start-container

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,51 @@ WORKDIR /var/www/html
1010

1111
ENV DEBIAN_FRONTEND noninteractive
1212
ENV TZ=UTC
13+
ENV SUPERVISOR_PHP_COMMAND="/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80"
14+
ENV SUPERVISOR_PHP_USER="sail"
1315

1416
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1517

1618
RUN apt-get update \
1719
&& mkdir -p /etc/apt/keyrings \
18-
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch cron \
20+
&& 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 cron \
1921
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
2022
&& 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 \
23+
&& echo "MAILTO=\"\"\n* * * * * sail /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel \
2124
&& apt-get update \
22-
&& apt-get install -y php8.2-cli php8.2-dev \
23-
php8.2-pgsql php8.2-sqlite3 php8.2-gd \
24-
php8.2-curl \
25-
php8.2-mysql php8.2-mbstring \
26-
php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap \
27-
php8.2-intl php8.2-readline \
28-
php8.2-msgpack php8.2-igbinary php8.2-redis \
29-
php8.2-memcached php8.2-pcov php8.2-xdebug \
30-
&& echo "MAILTO=\"\"\n* * * * * sail /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel
25+
&& apt-get install -y php8.3-cli php8.3-dev \
26+
php8.3-pgsql php8.3-sqlite3 php8.3-gd \
27+
php8.3-curl \
28+
php8.3-mysql php8.3-mbstring \
29+
php8.3-xml php8.3-zip php8.3-bcmath php8.3-soap \
30+
php8.3-intl php8.3-readline \
31+
php8.3-msgpack php8.3-igbinary php8.3-redis \
32+
php8.3-memcached php8.3-pcov php8.3-xdebug
3133

3234
RUN curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
3335
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
3436
&& 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 \
35-
&& apt-get update \
36-
&& apt-get install -y nodejs \
37-
&& npm install -g npm
38-
39-
RUN curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
37+
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \
4038
&& 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 \
4139
&& curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash \
4240
&& apt-get update \
41+
&& apt-get install -y nodejs \
42+
&& npm install -g npm \
4343
&& apt-get install -y mysql-client \
4444
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
4545
&& apt-get install -y speedtest \
4646
&& apt-get -y autoremove \
4747
&& apt-get clean \
4848
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4949

50-
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2
50+
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.3
5151

5252
RUN groupadd --force -g $WWWGROUP sail
5353
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
5454

5555
COPY start-container /usr/local/bin/start-container
5656
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
57-
COPY php.ini /etc/php/8.2/cli/conf.d/99-sail.ini
57+
COPY php.ini /etc/php/8.3/cli/conf.d/99-sail.ini
5858
RUN chmod +x /usr/local/bin/start-container
5959

6060
EXPOSE 8000
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
post_max_size = 100M
33
upload_max_filesize = 100M
44
variables_order = EGPCS
5-
6-
[opcache]
7-
opcache.enable_cli=1
5+
pcov.directory = .

docker/8.3/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
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@ user=root
44
logfile=/var/log/supervisor/supervisord.log
55
pidfile=/var/run/supervisord.pid
66

7-
[program:cron]
8-
command=/usr/sbin/cron -f -l 8
9-
user=root
10-
autostart=true
11-
stdout_logfile=/var/log/cron.out.log
12-
stderr_logfile=/var/log/cron.err.log
13-
147
[program:php]
15-
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
16-
user=sail
8+
command=%(ENV_SUPERVISOR_PHP_COMMAND)s
9+
user=%(ENV_SUPERVISOR_PHP_USER)s
1710
environment=LARAVEL_SAIL="1"
1811
stdout_logfile=/dev/stdout
1912
stdout_logfile_maxbytes=0

0 commit comments

Comments
 (0)