Skip to content

Commit 9230f1b

Browse files
committed
Updated to PHP 8.5 + small fixes and improvements.
1 parent 1df3a18 commit 9230f1b

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

content/guides/frameworks/laravel/development-setup.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ A workspace container provides a dedicated shell for asset compilation, Artisan/
119119
```dockerfile
120120
# docker/development/workspace/Dockerfile
121121
# Use the official PHP CLI image as the base
122-
FROM php:8.4-cli
122+
FROM php:8.5-cli
123123

124124
# Set environment variables for user and group ID
125125
ARG UID=1000
@@ -141,13 +141,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
141141
pdo_mysql \
142142
pdo_pgsql \
143143
pgsql \
144-
opcache \
145144
intl \
146145
zip \
147146
bcmath \
148147
soap \
149-
&& pecl install redis xdebug \
150-
&& docker-php-ext-enable redis xdebug\
148+
&& pecl install redis \
149+
&& docker-php-ext-enable redis \
151150
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
152151
&& apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
153152

@@ -161,6 +160,7 @@ ARG XDEBUG_LOG_LEVEL
161160

162161
# Configure Xdebug if enabled
163162
RUN if [ "${XDEBUG_ENABLED}" = "true" ]; then \
163+
pecl install xdebug && \
164164
docker-php-ext-enable xdebug && \
165165
echo "xdebug.mode=${XDEBUG_MODE}" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
166166
echo "xdebug.idekey=${XDEBUG_IDE_KEY}" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \

content/guides/frameworks/laravel/production-setup.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ For production, the `php-fpm` Dockerfile creates an optimized image with only th
4747

4848
```dockerfile
4949
# Stage 1: Build environment and Composer dependencies
50-
FROM php:8.4-fpm AS builder
50+
FROM php:8.5-fpm AS builder
5151

5252
# Install system dependencies and PHP extensions for Laravel with MySQL/PostgreSQL support.
5353
# Dependencies in this stage are only required for building the final image.
@@ -66,7 +66,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6666
pdo_mysql \
6767
pdo_pgsql \
6868
pgsql \
69-
opcache \
7069
intl \
7170
zip \
7271
bcmath \
@@ -100,7 +99,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
10099
&& composer install --no-dev --optimize-autoloader --no-interaction --no-progress --prefer-dist
101100

102101
# Stage 2: Production environment
103-
FROM php:8.4-fpm AS production
102+
FROM php:8.5-fpm AS production
104103

105104
# Install only runtime libraries needed in production
106105
# libfcgi-bin and procps are required for the php-fpm-healthcheck script
@@ -175,7 +174,7 @@ If you need a separate CLI container with different extensions or strict separat
175174

176175
```dockerfile
177176
# Stage 1: Build environment and Composer dependencies
178-
FROM php:8.4-cli AS builder
177+
FROM php:8.5-cli AS builder
179178

180179
# Install system dependencies and PHP extensions required for Laravel + MySQL/PostgreSQL support
181180
# Some dependencies are required for PHP extensions only in the build stage
@@ -193,7 +192,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
193192
pdo_mysql \
194193
pdo_pgsql \
195194
pgsql \
196-
opcache \
197195
intl \
198196
zip \
199197
bcmath \
@@ -213,7 +211,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
213211
&& composer install --no-dev --optimize-autoloader --no-interaction --no-progress --prefer-dist
214212

215213
# Stage 2: Production environment
216-
FROM php:8.4-cli
214+
FROM php:8.5-cli
217215

218216
# Install client libraries required for php extensions in runtime
219217
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -246,7 +244,7 @@ USER www-data
246244
CMD ["bash"]
247245
```
248246

249-
This Dockerfile is similar to the PHP-FPM Dockerfile, but it uses the `php:8.4-cli` image as the base image and sets up the container for running CLI commands.
247+
This Dockerfile is similar to the PHP-FPM Dockerfile, but it uses the `php:8.5-cli` image as the base image and sets up the container for running CLI commands.
250248

251249
## Create a Dockerfile for Nginx (production)
252250

@@ -428,7 +426,7 @@ volumes:
428426
```
429427
430428
> [!NOTE]
431-
> Ensure you have an `.env` file at the root of your Laravel project with the necessary configurations (e.g., database and Xdebug settings) to match the Docker Compose setup.
429+
> Ensure you have an `.env` file at the root of your Laravel project with the necessary configurations to match the Docker Compose setup.
432430

433431
## Running your production environment
434432

0 commit comments

Comments
 (0)