Added healthcheck
parent
c7231d648c
commit
b11c4b4e9f
|
|
@ -38,3 +38,7 @@ ENV TZ=Etc/UTC
|
||||||
COPY etc/ /etc
|
COPY etc/ /etc
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# Healthcheck
|
||||||
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||||
|
CMD ["curl", "--fail", "http://localhost/healthcheck"]
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,12 @@ server {
|
||||||
server_name ${NGINX_HOST}
|
server_name ${NGINX_HOST}
|
||||||
index index.php index.htm;
|
index index.php index.htm;
|
||||||
|
|
||||||
|
location /healthcheck {
|
||||||
|
access_log off;
|
||||||
|
error_log off;
|
||||||
|
return 200 'ok';
|
||||||
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass ${PHP_HOST}:9000;
|
fastcgi_pass ${PHP_HOST}:9000;
|
||||||
|
|
@ -40,9 +46,16 @@ server {
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /status {
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_pass ${PHP_HOST}:9000;
|
||||||
|
fastcgi_param REQUEST_METHOD $request_method;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
#try_files $uri $uri/ /index.php?$query_string =404;
|
try_files $uri $uri/ /index.php?$query_string =404;
|
||||||
rewrite ^ index.php last;
|
#rewrite ^ index.php last;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -41,10 +41,13 @@ COPY etc/php /usr/local/etc/php/conf.d
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk upgrade && \
|
apk upgrade && \
|
||||||
apk add git && \
|
apk add git fcgi && \
|
||||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
# Enable php fpm status page
|
||||||
|
RUN set -xe && echo "pm.status_path = /status" >> /usr/local/etc/php-fpm.d/zz-docker.conf
|
||||||
|
|
||||||
# Install and execute own entrypoint script. This scrpit should hold all instructions that are not
|
# Install and execute own entrypoint script. This scrpit should hold all instructions that are not
|
||||||
# executed while the image is build (use RUN in this file therefore) but that are run when the
|
# executed while the image is build (use RUN in this file therefore) but that are run when the
|
||||||
# container starts up. One major advanatge is that mounted volumes are already available when this
|
# container starts up. One major advanatge is that mounted volumes are already available when this
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue