Sign inSign up

shinsenter/phpfpm-nginx

Sponsored OSS

By SHIN Company

•Updated about 9 hours ago

🌐 (PHP) PHP-FPM + Nginx, production-ready with HTTPS out of the box

Image
Languages & frameworks
Developer tools
Web servers
14

500K+

shinsenter/phpfpm-nginx repository overview

⁠shinsenter/phpfpm-nginx

🌐 (PHP) PHP-FPM + Nginx, production-ready with HTTPS out of the box

⁠Quick start

docker run -p 80:80 -p 443:443 -p 443:443/udp \
    -v ./myproject:/var/www/html \
    shinsenter/phpfpm-nginx:latest

Open http://localhost⁠ (or https://localhost⁠ with the test certificate). Your code lives in /var/www/html. If you mount an empty folder, the container can create a project for you: set INITIAL_PROJECT, for example -e INITIAL_PROJECT=laravel/laravel.

The images include the latest Composer⁠. PHP settings change through PHP_* environment variables, so you do not need to rebuild the image.

Need a specific PHP version? See the tags on Docker Hub⁠. For a plain PHP image without Nginx, see shinsenter/php⁠.

⁠Common settings

Pass them with -e NAME=value or in environment: of your compose file.

VariableWhat it doesDefault
APP_PATHApplication directory inside the container./var/www/html
DOCUMENT_ROOTFolder inside APP_PATH that the web server serves.project root
APP_USER, APP_GROUP, APP_UID, APP_GIDRun as another user and group.www-data
TZContainer timezone, for example Asia/Tokyo.UTC
DEBUG1 prints verbose logs, including which hooks run.not set
ENABLE_CRONTAB, CRONTAB_SETTINGSTurn on cron and define jobs, for example * * * * * php -f /var/www/html/cron.php.not set
PHP_*Any php.ini setting, for example PHP_MEMORY_LIMIT=512M, PHP_UPLOAD_MAX_FILESIZE=100M. Run php-envvars in the container to list them.image defaults
ENABLE_TUNING_FPM1 sets PHP-FPM pm.* values from the CPU limit of the container.not set

The full list (cron, SSH, autorun switches) is in the shinsenter/php⁠ documentation.

⁠HTTPS

The image ships a self-signed certificate for local tests:

  • /etc/ssl/site/server.crt
  • /etc/ssl/site/server.key

For production, replace both files with your own, by mounting them:

services:
  web:
    image: shinsenter/phpfpm-nginx:latest
    volumes:
      - ./myproject:/var/www/html
      - ./my_domain.crt:/etc/ssl/site/server.crt
      - ./my_domain.key:/etc/ssl/site/server.key

or by copying them in your own Dockerfile:

FROM shinsenter/phpfpm-nginx:latest
COPY my_domain.crt /etc/ssl/site/server.crt
COPY my_domain.key /etc/ssl/site/server.key

⁠Customize Nginx

Mount or copy your *.conf files into /etc/nginx/custom.d/. They are loaded into Nginx's default server.

docker run -p 80:80 -p 443:443 -p 443:443/udp \
    -v ./myproject:/var/www/html \
    -v ./my-site.conf:/etc/nginx/custom.d/my-site.conf:ro \
    shinsenter/phpfpm-nginx:latest

āš ļø This folder already holds common config files. Mount single files into it. Do not replace the whole folder.

⁠Extend the image

FROM shinsenter/phpfpm-nginx:latest

# Your own steps, for example:
ADD --chown=$APP_USER:$APP_GROUP ./myproject/ /var/www/html/

Adding PHP extensions, hooks, autorun scripts and cron jobs are covered in shinsenter/php⁠.

⁠Image tags and platforms

  • All tags and platforms: Docker Hub⁠. Debian and Alpine variants are available.
  • Since 2026-10-25, linux/386, linux/arm/v7, linux/ppc64le and linux/s390x are no longer built. Older tags keep them until they are rebuilt.
  • Images are rebuilt when PHP, the base OS or Composer publish an update, so a tag can change over time. For production, pin your own copy:
docker pull shinsenter/phpfpm-nginx:latest
docker tag  shinsenter/phpfpm-nginx:latest your-repo/phpfpm-nginx:stable
docker push your-repo/phpfpm-nginx:stable

⁠Support the project

Keeping these images rebuilt for every PHP release takes ongoing work. If they save you time, you can help keep them going:

Reporting a bug, sharing the project or giving it a star on GitHub⁠ also helps.

⁠Issues and license


From Vietnam šŸ‡»šŸ‡³ with love.

Tag summary

Content type

Image

Digest

sha256:0d53be1f8…

Size

87.4 MB

Last updated

about 9 hours ago

docker pull shinsenter/phpfpm-nginx:dev-php8.1

This week's pulls

Pulls:

8,852

Oct 26 to Nov 1