1
0
Fork 0
pixelfed/contrib/docker/Dockerfile.fpm

95 lines
2.7 KiB
Docker
Raw Normal View History

FROM php:7.4-fpm-buster
2020-04-11 15:48:02 +00:00
# Use the default production configuration
COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini"
# Install Composer
ENV COMPOSER_VERSION 1.9.2
ENV COMPOSER_HOME /var/www/.composer
RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --version=${COMPOSER_VERSION} && rm -rf /tmp/composer-setup.php
# Update OS Packages
RUN apt-get update
# Install OS Packages
RUN apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y --no-install-recommends \
## Standard
locales locales-all \
git \
gosu \
zip \
unzip \
libzip-dev \
libcurl4-openssl-dev \
## Image Optimization
optipng \
pngquant \
jpegoptim \
gifsicle \
## Image Processing
libjpeg62-turbo-dev \
libpng-dev \
# Required for GD
libxpm4 \
libxpm-dev \
libwebp6 \
libwebp-dev \
## Video Processing
ffmpeg
# Update Local data
RUN sed -i '/en_US/s/^#//g' /etc/locale.gen && locale-gen && update-locale
# Install PHP extensions
RUN docker-php-source extract
#PHP Imagemagick extensions
RUN apt-get install -y --no-install-recommends libmagickwand-dev
RUN pecl install imagick
RUN docker-php-ext-enable imagick
# PHP GD extensions
RUN docker-php-ext-configure gd \
Fix breaking docker build The Dockerfile.apache has been updated recently, but Dockerfile.fpm not. Due to this, the docker build is failing with the following error: ``` configure: error: unrecognized options: --enable-freetype The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends apt-utils && apt-get install -y --no-install-recommends git gosu optipng pngquant jpegoptim gifsicle libpq-dev libsqlite3-dev locales zip unzip libzip-dev libcurl4-openssl-dev libfreetype6 libicu-dev libjpeg62-turbo libpng16-16 libxpm4 libwebp6 libmagickwand-6.q16-6 libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libwebp-dev libmagickwand-dev mariadb-client && sed -i '/en_US/s/^#//g' /etc/locale.gen && locale-gen && update-locale && docker-php-source extract && docker-php-ext-configure gd --enable-freetype --with-jpeg-dir=/usr/lib/x86_64-linux-gnu/ --with-xpm-dir=/usr/lib/x86_64-linux-gnu/ --with-webp-dir=/usr/lib/x86_64-linux-gnu/ && docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite pcntl gd exif bcmath intl zip curl && pecl install imagick && docker-php-ext-enable imagick pcntl imagick gd exif zip curl && curl -LsS https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar -o /usr/bin/composer && echo "${COMPOSER_CHECKSUM} /usr/bin/composer" | sha256sum -c - && chmod 755 /usr/bin/composer && apt-get autoremove --purge -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libvpx-dev libmagickwand-dev && rm -rf /var/cache/apt && docker-php-source delete' returned a non-zero code: 1 ``` This change updates Dockerfile.fpm to equal the Dockerfile.apache variant. (Except the fpm or apache specific settings)
2020-02-09 16:49:12 +00:00
--with-freetype \
--with-jpeg \
--with-webp \
2020-04-11 15:48:02 +00:00
--with-xpm
RUN docker-php-ext-install -j$(nproc) gd
#PHP Redis extensions
RUN pecl install redis
RUN docker-php-ext-enable redis
#PHP Database extensions
RUN apt-get install -y --no-install-recommends libpq-dev libsqlite3-dev
RUN docker-php-ext-install pdo_mysql pdo_pgsql pdo_sqlite
#PHP extensions (dependencies)
RUN docker-php-ext-configure intl
RUN docker-php-ext-install -j$(nproc) intl bcmath zip pcntl exif curl
#Cleanup
RUN docker-php-source delete
RUN apt-get autoremove --purge -y
RUN rm -rf /var/cache/apt
RUN rm -rf /var/lib/apt/lists/*
2018-05-20 13:02:29 +00:00
ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
COPY . /var/www/
WORKDIR /var/www/
2020-04-11 15:48:02 +00:00
RUN cp -r storage storage.skel
RUN composer global require hirak/prestissimo --no-interaction --no-suggest --prefer-dist
RUN composer install --prefer-dist --no-interaction --no-ansi --optimize-autoloader
RUN composer global remove hirak/prestissimo
RUN rm -rf html && ln -s public html
2020-04-11 15:48:02 +00:00
VOLUME /var/www/storage /var/www/bootstrap
CMD ["/var/www/contrib/docker/start.fpm.sh"]