Use two Dockerfiles, move Docker stuff to /docker

This commit is contained in:
zeke 2024-02-01 18:05:08 -08:00
parent ea99ddc6f6
commit dcc936b35d
9 changed files with 262 additions and 4 deletions

44
docker/php/Dockerfile Normal file
View file

@ -0,0 +1,44 @@
# Based on https://github.com/dead-guru/devichan/blob/master/php-fpm/Dockerfile
FROM composer AS composer
FROM php:8.1-fpm-bullseye
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY . /code
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
zlib1g-dev libicu-dev g++ \
libjpeg62-turbo-dev \
libzip-dev \
libpng-dev \
libwebp-dev \
libfreetype6-dev \
libxml2-dev \
git \
zip \
ffmpeg \
libonig-dev \
unzip \
libcurl4-openssl-dev \
libmagickwand-dev \
gifsicle \
graphicsmagick \
gettext \
imagemagick \
locales locales-all \
libmagickwand-dev \
libmcrypt-dev \
&& docker-php-ext-configure gd \
--with-webp=/usr/include/webp \
--with-jpeg=/usr/include \
--with-freetype=/usr/include/freetype2/ \
&& pecl install redis \
&& pecl install imagick \
&& pecl install -o -f igbinary \
&& docker-php-ext-install gd zip opcache intl pdo pdo_mysql mysqli bcmath gettext iconv mbstring curl \
&& docker-php-ext-enable igbinary redis imagick
RUN /code/docker/common-setup.sh
WORKDIR "/var/www-leftypol"
CMD ["php-fpm"]
EXPOSE 9000

15
docker/php/custom.ini Normal file
View file

@ -0,0 +1,15 @@
; based on https://github.com/dead-guru/devichan/blob/master/php-fpm/custom.ini
memory_limit = 2G
max_execution_time = 30
upload_max_filesize = 2G
post_max_size = 2G
pm = dynamic
pm.max_children = 20
pm.start_servers = 5
pm.min_spare_servers = 3
pm.max_spare_servers = 10
extension = igbinary.so
extension = redis.so
extension = imagick.so

10
docker/php/www.conf Normal file
View file

@ -0,0 +1,10 @@
[www]
user = leftypol
group = leftypol
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 200
pm.start_servers = 10
pm.min_spare_servers = 1
pm.max_spare_servers = 20
pm.max_requests = 20000