-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely refactored PHP 8.1 image, added Blackfire support
- Loading branch information
Showing
4 changed files
with
89 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
BLACKFIRE_DISABLE_LEGACY_PORT=true | ||
BLACKFIRE_LOG_LEVEL= | ||
BLACKFIRE_SERVER_ID= | ||
BLACKFIRE_SERVER_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
BLACKFIRE_CLIENT_ID= | ||
BLACKFIRE_CLIENT_TOKEN= | ||
COMPOSER_DISABLE_XDEBUG_WARN=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,92 +2,93 @@ FROM php:8.1.4-fpm-buster | |
MAINTAINER Mark Shust <[email protected]> | ||
|
||
ARG APP_ID=1000 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
cron \ | ||
default-mysql-client \ | ||
git \ | ||
gzip \ | ||
libbz2-dev \ | ||
libfreetype6-dev \ | ||
libicu-dev \ | ||
libwebp-dev \ | ||
libjpeg62-turbo-dev \ | ||
libmcrypt-dev \ | ||
libonig-dev \ | ||
libpng-dev \ | ||
libsodium-dev \ | ||
libssh2-1-dev \ | ||
libxslt1-dev \ | ||
libzip-dev \ | ||
lsof \ | ||
procps \ | ||
vim \ | ||
zip | ||
|
||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp | ||
|
||
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 \ | ||
&& docker-php-ext-enable xdebug | ||
|
||
RUN pecl install ssh2-1.3.1 \ | ||
&& docker-php-ext-enable ssh2 | ||
|
||
RUN pecl install redis \ | ||
&& docker-php-ext-enable redis | ||
|
||
RUN apt-get install -y libmagickwand-dev \ | ||
&& pecl install imagick \ | ||
&& docker-php-ext-enable imagick | ||
|
||
RUN groupadd -g "$APP_ID" app \ | ||
&& useradd -g "$APP_ID" -u "$APP_ID" -d /var/www -s /bin/bash app | ||
|
||
RUN apt-get install -y gnupg \ | ||
&& curl -sL https://deb.nodesource.com/setup_14.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 mkdir -p /etc/nginx/html /var/www/html /sock \ | ||
&& chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock | ||
|
||
RUN apt-get install -y msmtp mailutils | ||
COPY conf/msmtprc /etc/msmtprc | ||
RUN apt-get update && apt-get install -y \ | ||
cron \ | ||
default-mysql-client \ | ||
git \ | ||
gnupg \ | ||
gzip \ | ||
libbz2-dev \ | ||
libfreetype6-dev \ | ||
libicu-dev \ | ||
libwebp-dev \ | ||
libjpeg62-turbo-dev \ | ||
libmagickwand-dev \ | ||
libmcrypt-dev \ | ||
libonig-dev \ | ||
libpng-dev \ | ||
libsodium-dev \ | ||
libssh2-1-dev \ | ||
libxslt1-dev \ | ||
libzip-dev \ | ||
lsof \ | ||
mailutils \ | ||
msmtp \ | ||
procps \ | ||
vim \ | ||
zip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pecl channel-update pecl.php.net && pecl install \ | ||
imagick \ | ||
redis \ | ||
ssh2-1.3.1 \ | ||
xdebug \ | ||
&& pecl clear-cache \ | ||
&& rm -rf /tmp/pear | ||
|
||
RUN docker-php-ext-configure \ | ||
gd --with-freetype --with-jpeg --with-webp \ | ||
&& 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 \ | ||
&& docker-php-ext-enable \ | ||
imagick \ | ||
redis \ | ||
ssh2 \ | ||
xdebug | ||
|
||
RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ | ||
&& architecture=$(uname -m) \ | ||
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \ | ||
&& mkdir -p /tmp/blackfire \ | ||
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ | ||
&& mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ | ||
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ | ||
&& rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz | ||
|
||
RUN curl -sS https://getcomposer.org/installer | \ | ||
php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
COPY conf/www.conf /usr/local/etc/php-fpm.d/ | ||
COPY conf/msmtprc /etc/msmtprc | ||
COPY conf/php.ini /usr/local/etc/php/ | ||
COPY conf/php-fpm.conf /usr/local/etc/ | ||
|
||
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 | ||
COPY conf/www.conf /usr/local/etc/php-fpm.d/ | ||
|
||
USER app:app | ||
|
||
VOLUME /var/www | ||
|
||
WORKDIR /var/www/html |