An alpine based PHP-fpm docker image with integrated healthcheck.
1.4K
An alpine based PHP-fpm docker image with integrated healthcheck.
To run this container in combination with nginx you need these two files:
docker-compose.ymlconf.d/php.confThe two files below or in this repo.
PHP will not work without conf.d/php.conf, create it before you deploy the container!
docker-compose.yml :
version: "3.5"
services:
################################
########## Nginx
nginx:
image: nginx:alpine
restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "--fail", "http://localhost" ]
start_period: 5s
interval: 5s
timeout: 5s
retries: 15
networks:
- backend
ports:
- 80:80
volumes:
- ./www:/code
- ./conf.d:/etc/nginx/conf.d
########## PHP
php:
image: dustin36x/php:latest
restart: unless-stopped
networks:
- backend
volumes:
- ./www:/code
################################
networks:
backend:
external: false
driver: bridge
################################
conf.d/php.conf :
server {
index index.php index.html;
server_name nginx;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
php-fpm-healtcheck by Renato Mefi
Distributed under MIT License
Content type
Image
Digest
sha256:a63fa9e06…
Size
29 MB
Last updated
over 3 years ago
docker pull dustin36x/php-health