@@ -3,16 +3,16 @@ FROM composer:2 as composer_stage
33RUN rm -rf /var/www && mkdir -p /var/www/html
44WORKDIR /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
109RUN 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
1818RUN 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
4040RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted
4141ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
4242
43- # Install and enable php extensions
43+ # Install and enable PHP extensions
4444RUN docker-php-ext-enable \
4545 imagick \
4646 xdebug
47- RUN docker-php-ext-configure zip
47+ RUN docker-php-ext-configure zip
4848RUN 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
5858WORKDIR /var/www/html
5959COPY src src/
6060COPY --from=composer_stage /usr/bin/composer /usr/bin/composer
6161COPY 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
6665CMD ["php-fpm" ]
6766
68- EXPOSE 9000
67+ EXPOSE 9000
0 commit comments