FROM php:8.0-fpm
RUN apt-get update -y
RUN apt-get install -y \
git \
curl \
libz-dev \
libcurl4-openssl-dev \
libxml2-dev \
libssl-dev \
libpng-dev \
libonig-dev \
libmpdec-dev \
libzip-dev \
libevent-dev \
libicu-dev
# PHP extension
RUN docker-php-ext-install intl
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install calendar
RUN docker-php-ext-install pcntl
RUN docker-php-ext-install gd
RUN docker-php-ext-install sockets
RUN docker-php-ext-install zip
RUN pecl install igbinary && docker-php-ext-enable igbinary
# decimal
RUN docker-php-source extract \
&& git clone --branch 1.x-php8 --depth 1 https://github.com/zlodes/ext-decimal.git /usr/src/php/ext/decimal \
&& cd /usr/src/php/ext/decimal && git submodule update --init \
&& docker-php-ext-install decimal
# Redis
RUN pecl install redis-5.3.2 && docker-php-ext-enable redis
# MySQL
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install pdo_mysql
# php.ini
COPY ./php.ini /usr/local/etc/php/php.ini
# Composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer \
--install-dir=/usr/local/bin && \
echo "alias composer='composer'" >> /root/.bashrc
CMD ["php-fpm", "-F"]
WORKDIR /var/www
EXPOSE 9000
/bin/sh: 1: sudo: not found
curl: (23) Failed writing body (0 != 16230)
ERROR: Service 'php' failed to build: The command '/bin/sh -c curl -sS https://getcomposer.org/installer | sudo php -- --filename=composer --install-dir=/usr/local/bin && echo "alias composer='composer'" >> /root/.bashrc' returned a non-zero code: 127
Fatal error: Directive 'track_errors' is no longer available in PHP in Unknown on line 0