Skip to content

Commit 5adf49a

Browse files
use php 8.2 in Dockerfile
1 parent 8836d2b commit 5adf49a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Dockerfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ FROM composer:2 as composer_stage
33
RUN rm -rf /var/www && mkdir -p /var/www/html
44
WORKDIR /var/www/html
55

6-
7-
FROM php:8.1.6RC1-fpm-alpine3.15
6+
FROM php:8.2-fpm-alpine
87

98
# Install dev dependencies
109
RUN apk add --no-cache --virtual .build-deps \
1110
$PHPIZE_DEPS \
1211
curl-dev \
1312
imagemagick-dev \
1413
libtool \
15-
libxml2-dev
14+
libxml2-dev \
15+
linux-headers # Add linux-headers here
1616

1717
# Install production dependencies
1818
RUN apk add --no-cache \
@@ -36,15 +36,15 @@ RUN pecl install \
3636
imagick \
3737
xdebug
3838

39-
# We currently can't natively pull iconv with PHP8, see: https://github.com/docker-library/php/issues/240#issuecomment-876464325
39+
# Workaround for iconv with PHP8
4040
RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted
4141
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
4242

43-
# Install and enable php extensions
43+
# Install and enable PHP extensions
4444
RUN docker-php-ext-enable \
4545
imagick \
4646
xdebug
47-
RUN docker-php-ext-configure zip
47+
RUN docker-php-ext-configure zip
4848
RUN docker-php-ext-install \
4949
curl \
5050
pdo \
@@ -53,16 +53,15 @@ RUN docker-php-ext-install \
5353
xml \
5454
gd \
5555
zip \
56-
bcmath
56+
bcmath
5757

5858
WORKDIR /var/www/html
5959
COPY src src/
6060
COPY --from=composer_stage /usr/bin/composer /usr/bin/composer
6161
COPY composer.json /var/www/html/
62-
# This are production settings, I'm running with 'no-dev', adjust accordingly
63-
# if you need it
64-
RUN composer install
62+
# Install composer dependencies
63+
RUN composer install --no-dev --optimize-autoloader
6564

6665
CMD ["php-fpm"]
6766

68-
EXPOSE 9000
67+
EXPOSE 9000

0 commit comments

Comments
 (0)