2023-01-07 21:49:22 +00:00
|
|
|
FROM php:8.1-fpm-bullseye
|
2020-04-11 15:48:02 +00:00
|
|
|
|
2023-01-07 21:49:22 +00:00
|
|
|
ENV COMPOSER_MEMORY_LIMIT=-1
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
WORKDIR /var/www/
|
2020-04-11 15:48:02 +00:00
|
|
|
|
2023-01-07 21:49:22 +00:00
|
|
|
# Get Composer binary
|
|
|
|
COPY --from=composer:2.4.4 /usr/bin/composer /usr/bin/composer
|
2020-04-11 15:48:02 +00:00
|
|
|
|
2023-01-07 21:49:22 +00:00
|
|
|
# Install package dependencies
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get upgrade -y \
|
|
|
|
# && apt-get install -y --no-install-recommends apt-utils \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
2020-04-11 15:48:02 +00:00
|
|
|
## Standard
|
2023-01-07 21:49:22 +00:00
|
|
|
locales \
|
|
|
|
locales-all \
|
2020-04-11 15:48:02 +00:00
|
|
|
git \
|
|
|
|
gosu \
|
|
|
|
zip \
|
2023-01-07 21:49:22 +00:00
|
|
|
unzip \
|
|
|
|
libzip-dev \
|
2020-04-11 15:48:02 +00:00
|
|
|
libcurl4-openssl-dev \
|
|
|
|
## Image Optimization
|
|
|
|
optipng \
|
|
|
|
pngquant \
|
|
|
|
jpegoptim \
|
|
|
|
gifsicle \
|
|
|
|
## Image Processing
|
|
|
|
libjpeg62-turbo-dev \
|
|
|
|
libpng-dev \
|
2023-01-07 21:49:22 +00:00
|
|
|
libmagickwand-dev \
|
2020-04-11 15:48:02 +00:00
|
|
|
# Required for GD
|
|
|
|
libxpm4 \
|
|
|
|
libxpm-dev \
|
|
|
|
libwebp6 \
|
|
|
|
libwebp-dev \
|
|
|
|
## Video Processing
|
2023-01-07 21:49:22 +00:00
|
|
|
ffmpeg \
|
|
|
|
## Database
|
|
|
|
# libpq-dev \
|
|
|
|
# libsqlite3-dev \
|
|
|
|
mariadb-client \
|
|
|
|
# Locales Update
|
|
|
|
&& sed -i '/en_US/s/^#//g' /etc/locale.gen \
|
|
|
|
&& locale-gen \
|
|
|
|
&& update-locale \
|
2020-04-11 15:48:02 +00:00
|
|
|
# Install PHP extensions
|
2023-01-07 21:49:22 +00:00
|
|
|
&& docker-php-source extract \
|
2020-04-11 15:48:02 +00:00
|
|
|
#PHP Imagemagick extensions
|
2023-01-07 21:49:22 +00:00
|
|
|
&& pecl install imagick \
|
|
|
|
&& docker-php-ext-enable imagick \
|
2020-04-11 15:48:02 +00:00
|
|
|
# PHP GD extensions
|
2023-01-07 21:49:22 +00:00
|
|
|
&& docker-php-ext-configure gd \
|
2020-02-09 16:49:12 +00:00
|
|
|
--with-freetype \
|
|
|
|
--with-jpeg \
|
|
|
|
--with-webp \
|
2023-01-07 21:49:22 +00:00
|
|
|
--with-xpm \
|
|
|
|
&& docker-php-ext-install -j$(nproc) gd \
|
2020-04-11 15:48:02 +00:00
|
|
|
#PHP Redis extensions
|
2023-01-07 21:49:22 +00:00
|
|
|
&& pecl install redis \
|
|
|
|
&& docker-php-ext-enable redis \
|
2020-04-11 15:48:02 +00:00
|
|
|
#PHP Database extensions
|
2023-01-07 21:49:22 +00:00
|
|
|
&& docker-php-ext-install pdo_mysql \
|
|
|
|
#pdo_pgsql pdo_sqlite \
|
2020-04-11 15:48:02 +00:00
|
|
|
#PHP extensions (dependencies)
|
2023-01-07 21:49:22 +00:00
|
|
|
&& docker-php-ext-configure intl \
|
|
|
|
&& docker-php-ext-install -j$(nproc) intl bcmath zip pcntl exif curl \
|
2020-04-11 15:48:02 +00:00
|
|
|
#Cleanup
|
2023-01-07 21:49:22 +00:00
|
|
|
&& docker-php-source delete \
|
|
|
|
&& apt-get autoremove --purge -y \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/cache/apt \
|
|
|
|
&& rm -rf /var/lib/apt/lists/
|
2018-11-20 16:51:24 +00:00
|
|
|
|
2023-01-07 21:49:22 +00:00
|
|
|
# Use the default production configuration
|
|
|
|
COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini"
|
2018-11-20 16:51:24 +00:00
|
|
|
|
|
|
|
COPY . /var/www/
|
2023-01-07 21:49:22 +00:00
|
|
|
# for detail why storage is copied this way, pls refer to https://github.com/pixelfed/pixelfed/pull/2137#discussion_r434468862
|
|
|
|
RUN cp -r storage storage.skel \
|
|
|
|
&& composer install --prefer-dist --no-interaction --no-ansi --optimize-autoloader \
|
|
|
|
&& rm -rf html && ln -s public html \
|
|
|
|
&& chown -R www-data:www-data /var/www
|
2018-11-20 16:51:24 +00:00
|
|
|
|
2023-01-07 21:49:22 +00:00
|
|
|
RUN php artisan horizon:publish
|
2018-11-20 16:51:24 +00:00
|
|
|
|
2020-04-11 15:48:02 +00:00
|
|
|
VOLUME /var/www/storage /var/www/bootstrap
|
2023-01-07 21:49:22 +00:00
|
|
|
|
2020-04-11 15:48:02 +00:00
|
|
|
CMD ["/var/www/contrib/docker/start.fpm.sh"]
|