Sign inSign up

kekasigen/nginx-php-fpm

By kekasigen

•Updated 5 days ago

Docker image Nginx dan PHP-FPM yang ringan, optimal, dan siap menjalankan aplikasi PHP modern.

Image
Developer tools
Web servers
0

106

kekasigen/nginx-php-fpm repository overview

⁠NGINX + PHP-FPM Docker Image

A Docker image that combines NGINX and PHP-FPM in a single container, providing a ready-to-use environment for running PHP web applications.

Built on Debian Linux, this image integrates NGINX as the web server and PHP-FPM as the FastCGI process manager, with Supervisor managing both services.

⁠Features

  • NGINX — Handles HTTP requests and serves static files.
  • PHP-FPM — Executes PHP applications through FastCGI.
  • PHP Extensions — Includes commonly used extensions for database connectivity, image processing, XML, networking, and other application requirements.
  • Elastic APM PHP Agent — Supports application performance monitoring and integration with Elastic APM.
  • Supervisor — Manages NGINX and PHP-FPM processes within the container.
  • FastCGI Integration — Connects NGINX to PHP-FPM for processing PHP requests.
  • Container Logging — Supports centralized log inspection through Docker.
  • Application Ready — Suitable for PHP applications and frameworks such as CodeIgniter and other compatible projects.

⁠Quick Start

Pull the image:

docker pull kekasigen/nginx-php-fpm:latest

Run the container:

docker run -d \
  --name nginx-php-fpm \
  -p 8080:80 \
  kekasigen/nginx-php-fpm:latest

Access the application at:

http://localhost:8080⁠

⁠Docker Compose

services:
  web:
    image: kekasigen/nginx-php-fpm:latest
    container_name: nginx-php-fpm
    ports:
      - "8080:80"
    volumes:
      - ./app:/var/www/html
    restart: unless-stopped

Start the service:

docker compose up -d

⁠Application Configuration

  • Default document root: /var/www/html
  • HTTP port: 80
  • PHP-FPM communicates with NGINX through FastCGI.
  • PHP settings, NGINX configuration, and application files can be customized to meet deployment requirements.

Review the image configuration and source Dockerfile before mounting application files or changing service settings.

⁠Monitoring and Troubleshooting

View container logs:

docker logs -f nginx-php-fpm

Check service status:

docker exec nginx-php-fpm supervisorctl status

Validate NGINX configuration:

docker exec nginx-php-fpm nginx -t

Check PHP version and installed extensions:

docker exec nginx-php-fpm php -v
docker exec nginx-php-fpm php -m

⁠Security Recommendations

  • Rebuild regularly to incorporate applicable security updates.
  • Review the installed NGINX and PHP versions and their security advisories.
  • Use explicit version tags for reproducible production deployments.
  • Configure HTTPS through an appropriate reverse proxy or TLS termination layer.
  • Avoid exposing PHP-FPM directly to public networks.
  • Configure file permissions, resource limits, and application settings appropriately.

⁠Source Code

Docker Hub: https://hub.docker.com/r/kekasigen/nginx-php-fpm⁠

GitHub: https://github.com/kekasicoid/Dockerfile-Collections/tree/main/nginx-php-fpm⁠

Website : https://kekasi.co.id/nginx-php-fpm-docker-image/⁠

Tag summary

Content type

Image

Digest

sha256:9b25237d1…

Size

204.1 MB

Last updated

5 days ago

docker pull kekasigen/nginx-php-fpm:8.4.27