File tree Expand file tree Collapse file tree 5 files changed +35
-24
lines changed
Expand file tree Collapse file tree 5 files changed +35
-24
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ ENV CFLAGS="-I/usr/src/php"
2222
2323# tzdata to set the timezones through the environment variables
2424RUN apk --no-cache add \
25- tzdata
25+ tzdata \
26+ fcgi
2627
2728# PHP-EXTENSION-INSTALLER
2829RUN \
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ RUN apk --no-cache add \
2626 tzdata \
2727 supervisor \
2828 nginx \
29+ fcgi \
2930 ; \
3031 # mkdir -p /run/nginx ; \
3132 mkdir -p /etc/ssl/nginx ; \
Original file line number Diff line number Diff line change @@ -23,16 +23,16 @@ ENV TERM=xterm
2323ENV CFLAGS="-I/usr/src/php"
2424
2525# TOOLS
26- # RUN apt-get update; \
27- # apt-get install -y --no-install-recommends \
28- # curl \
29- # wget \
30- # #git \
31- # #zip unzip \
32- # #patch \
33- # #netcat-openbsd \
34- # ; \
35- # rm -rf /var/lib/apt/lists/*
26+ RUN apt-get update; \
27+ apt-get install -y --no-install-recommends \
28+ # curl \
29+ wget \
30+ # unzip \
31+ # patch \
32+ netcat-openbsd \
33+ libfcgi-bin \
34+ ; \
35+ rm -rf /var/lib/apt/lists/*
3636
3737# PHP-EXTENSION-INSTALLER
3838RUN \
Original file line number Diff line number Diff line change @@ -23,16 +23,16 @@ ENV TERM=xterm
2323ENV CFLAGS="-I/usr/src/php"
2424
2525# TOOLS
26- # RUN apt-get update; \
27- # apt-get install -y --no-install-recommends \
28- # curl \
29- # wget \
30- # #git \
31- # #zip unzip \
32- # #patch \
33- # #netcat-openbsd \
34- # ; \
35- # rm -rf /var/lib/apt/lists/*
26+ RUN apt-get update; \
27+ apt-get install -y --no-install-recommends \
28+ # curl \
29+ wget \
30+ # unzip \
31+ # patch \
32+ netcat-openbsd \
33+ libfcgi-bin \
34+ ; \
35+ rm -rf /var/lib/apt/lists/*
3636
3737# PHP-EXTENSION-INSTALLER
3838RUN \
Original file line number Diff line number Diff line change 151151# Status/Ping
152152if [ " $PHP_FPM_IS_EXISTS " -eq " 1" -a " $ENABLE_PHP_FPM_STATUS " -eq " 1" ]; then
153153 echo " >> enabling php-fpm status!"
154+
155+ PHP_FPM_PING_RESPONSE=" pong"
156+
154157 cat > ${PHP_FPM_CONF_DIR_PATH} /y-status.conf << EOF
155158[www]
156- ; status page (example: http://localhost: ${PHP_FPM_STATUS_PORT}${PHP_FPM_STATUS_PATH} ?json&full)
159+ ; status page
157160pm.status_path = ${PHP_FPM_STATUS_PATH}
158161pm.status_listen = ${PHP_FPM_STATUS_PORT}
159162; ping (healtcheck)
160163ping.path = ${PHP_FPM_PING_PATH}
161- ;ping.response = pong
164+ ;ping.response = ${PHP_FPM_PING_RESPONSE}
162165EOF
163166
167+ echo " >> ... and create php-fpm-healthcheck.sh"
168+ cat > /usr/local/bin/php-fpm-healthcheck.sh << EOF
169+ #!/bin/sh
170+ # required: fcgi (alpine) or libfcgi-bin (debian)
171+ SCRIPT_NAME="${PHP_FPM_PING_PATH} " SCRIPT_FILENAME="${PHP_FPM_PING_PATH} " REQUEST_METHOD=GET cgi-fcgi -bind -connect "127.0.0.1:${PHP_FPM_STATUS_PORT} " | grep ${PHP_FPM_PING_RESPONSE}
172+ EOF
173+ chmod +x /usr/local/bin/php-fpm-healthcheck.sh
164174fi
165175
166176# Settings (Log, ...)
@@ -169,7 +179,6 @@ if [ "$PHP_FPM_IS_EXISTS" -eq "1" ]; then
169179[www]
170180access.format = "%R - %u %t \"%m %r%Q%q\" %s"
171181EOF
172-
173182fi
174183
175184# ###################################################
You can’t perform that action at this time.
0 commit comments