Skip to content

Commit

Permalink
New image "8.0-fpm-develop" available for testing purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
markshust committed Dec 7, 2020
1 parent 2602909 commit 66c1d92
Show file tree
Hide file tree
Showing 7 changed files with 565 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

N/A
- New PHP image with tag `8.0-fpm-develop` available for testing purposes.

## [34.2.0] - 2020-10-15

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ View Dockerfiles:
- [`1.18-1`](https://github.com/markshust/docker-magento/tree/31.0.1/images/nginx/1.18)
- [`1.18-0`](https://github.com/markshust/docker-magento/tree/31.0.0/images/nginx/1.18)
- [markoshust/magento-php (Docker Hub)](https://hub.docker.com/r/markoshust/magento-php/)
- 8.0 (Currently in "development" for testing purposes.)
- [`8.0-fpm-develop`](https://github.com/markshust/docker-magento/tree/master/images/php/8.0)
- 7.4
- [`7.4-fpm`, `7.4-fpm-2`](https://github.com/markshust/docker-magento/tree/master/images/php/7.4)
- [`7.4-fpm-1`](https://github.com/markshust/docker-magento/tree/34.1.0/images/php/7.4)
Expand Down
94 changes: 94 additions & 0 deletions images/php/8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
FROM php:8.0-fpm-buster
MAINTAINER Mark Shust <mark@shust.com>

RUN apt-get update && apt-get install -y \
cron \
default-mysql-client \
git \
gzip \
libbz2-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libonig-dev \
libpng-dev \
libsodium-dev \
libxslt1-dev \
libzip-dev \
lsof \
procps \
vim \
zip

RUN docker-php-ext-configure gd --with-freetype --with-jpeg

RUN docker-php-ext-install \
bcmath \
bz2 \
calendar \
exif \
gd \
gettext \
intl \
mbstring \
mysqli \
opcache \
pcntl \
pdo_mysql \
soap \
sockets \
sodium \
sysvmsg \
sysvsem \
sysvshm \
xsl \
zip

RUN pecl channel-update pecl.php.net \
&& pecl install xdebug

RUN docker-php-ext-enable xdebug \
&& sed -i -e 's/^zend_extension/\;zend_extension/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

RUN groupadd -g 1000 app \
&& useradd -g 1000 -u 1000 -d /var/www -s /bin/bash app

RUN apt-get install -y gnupg \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs \
&& mkdir /var/www/.config /var/www/.npm \
&& chown app:app /var/www/.config /var/www/.npm \
&& npm install -g grunt-cli

RUN curl -sSLO https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \
&& chmod +x mhsendmail_linux_amd64 \
&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail

RUN curl -sS https://getcomposer.org/installer | \
php -- --1 --install-dir=/usr/local/bin --filename=composer

RUN curl -s https://packages.blackfire.io/gpg.key | apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \
&& apt-get update \
&& apt-get install blackfire-agent blackfire-php

RUN printf '* *\t* * *\tapp\t%s/usr/local/bin/php /var/www/html/update/cron.php\n' >> /etc/crontab \
&& printf '* *\t* * *\tapp\t%s/usr/local/bin/php /var/www/html/bin/magento cron:run\n' >> /etc/crontab \
&& printf '* *\t* * *\tapp\t%s/usr/local/bin/php /var/www/html/bin/magento setup:cron:run\n#\n' >> /etc/crontab

COPY conf/www.conf /usr/local/etc/php-fpm.d/
COPY conf/php.ini /usr/local/etc/php/
COPY conf/php-fpm.conf /usr/local/etc/
COPY bin/cronstart /usr/local/bin/

RUN mkdir -p /etc/nginx/html /var/www/html /sock \
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock

USER app:app

VOLUME /var/www

WORKDIR /var/www/html

EXPOSE 9001
7 changes: 7 additions & 0 deletions images/php/8.0/bin/cronstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
service cron start

touch /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status
chown app:app /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status

/usr/bin/crontab
31 changes: 31 additions & 0 deletions images/php/8.0/conf/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
; This file was initially adapated from the output of: (on PHP 5.6)
; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default

[global]

error_log = /proc/self/fd/2
daemonize = no

[www]

; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2

;user = app
;group = app

listen = /sock/docker.sock
listen.owner = app
listen.group = app
listen.mode = 0660

pm = dynamic
pm.max_children = 10
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes
17 changes: 17 additions & 0 deletions images/php/8.0/conf/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
memory_limit = 4G
max_execution_time = 1800
zlib.output_compression = On
cgi.fix_pathinfo = 0
date.timezone = UTC

xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_host = host.docker.internal
xdebug.remote_port = 9001
xdebug.idekey = PHPSTORM

upload_max_filesize = 100M
post_max_size = 100M
max_input_vars = 10000

sendmail_path = "/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025"
Loading

0 comments on commit 66c1d92

Please sign in to comment.