forked from docker-library/php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request docker-library#184 from infosiftr/fpm-conf
Refactor FPM support to use upstream's config file directly
- Loading branch information
Showing
7 changed files
with
144 additions
and
88 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,5 +1,40 @@ | ||
WORKDIR /var/www/html | ||
COPY php-fpm.conf /usr/local/etc/ | ||
|
||
RUN set -ex \ | ||
&& cd /usr/local/etc \ | ||
&& if [ -d php-fpm.d ]; then \ | ||
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" | ||
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ | ||
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ | ||
else \ | ||
# PHP 5.x don't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency | ||
mkdir php-fpm.d; \ | ||
cp php-fpm.conf.default php-fpm.d/www.conf; \ | ||
{ \ | ||
echo '[global]'; \ | ||
echo 'include=etc/php-fpm.d/*.conf'; \ | ||
} | tee php-fpm.conf; \ | ||
fi \ | ||
&& { \ | ||
echo '[global]'; \ | ||
echo 'error_log = /proc/self/fd/2'; \ | ||
echo; \ | ||
echo '[www]'; \ | ||
echo '; if we send this to /proc/self/fd/1, it never appears'; \ | ||
echo 'access.log = /proc/self/fd/2'; \ | ||
echo; \ | ||
echo 'clear_env = no'; \ | ||
echo; \ | ||
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ | ||
echo 'catch_workers_output = yes'; \ | ||
} | tee php-fpm.d/docker.conf \ | ||
&& { \ | ||
echo '[global]'; \ | ||
echo 'daemonize = no'; \ | ||
echo; \ | ||
echo '[www]'; \ | ||
echo 'listen = [::]:9000'; \ | ||
} | tee php-fpm.d/zz-docker.conf | ||
|
||
EXPOSE 9000 | ||
CMD ["php-fpm"] |