Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tangramor's avatar

Nginx + php8-fpm + nodejs docker image for Laravel 8/9/10/11 dev & deployment

https://hub.docker.com/r/tangramor/nginx-php8-fpm

If this image helped you, do not skimp on giving a star to it!

Based on php:8.5.1-fpm-alpine3.23, node:25.2.1-alpine3.23 (nodejs is not included in most of other nginx-php images...but needed by a lot of php frameworks), with nginx:alpine and richarvey/nginx-php-fpm's Docker script

  • Since php8.4.1_node23.3.0, PHP brotli module is added and swoole module is removed (it doesn't support 8.4 by now).
  • Since php8.3.6_node22.1.0, PHP imagick module is added.
  • Since php8.2.8_node20.5.0, PHP mongodb module is added and GD module's JPEG and FreeType support are enabled.
  • Since php8.1.8_node18.4.0, PHP amqp module is added.
  • Since php8.1.10_node18.8.0, PHP swoole module is added.
  • Since php8.1.12, added _withoutNodejs build for some pure PHP API frameworks like Lumen

Tags:

  • latest, php8.5.1_node25.2.1, php8.5.1_withoutNodejs (2026-01-16 alpine3.23) Note: PHP version is 8.5 now!
  • php8.4.16_node25.2.1, php8.4.16_withoutNodejs (2026-01-14 alpine3.23)
  • php8.4.15_node25.2.1, php8.4.15_withoutNodejs (2025-12-10 alpine3.22)
  • php8.4.14_node25.1.0, php8.4.14_withoutNodejs (2025-11-07 alpine3.22)
  • php8.4.12_node24.9.0, php8.4.12_withoutNodejs (2025-10-10 alpine3.22)
  • php8.4.12_node24.7.0, php8.4.12_withoutNodejs (2025-09-02 alpine3.22)
  • php8.4.11_node24.5.0, php8.4.11_withoutNodejs (2025-08-18 alpine3.22)
  • php8.4.10_node24.3.0, php8.4.10_withoutNodejs (2025-07-07 alpine3.22)
  • php8.4.7_node24.1.0, php8.4.7_withoutNodejs (2025-06-03 alpine3.21)
  • php8.4.6_node23.11.0, php8.4.6_withoutNodejs (2025-05-06 alpine3.21)
  • php8.4.5_node23.11.0, php8.4.5_withoutNodejs (2025-04-03 alpine3.21)
  • php8.4.4_node23.9.0, php8.4.4_withoutNodejs (2025-03-03 alpine3.21)
  • php8.4.3_node23.7.0, php8.4.3_withoutNodejs (2025-02-05 alpine3.21)
  • php8.4.2_node23.5.0, php8.4.2_withoutNodejs (2025-01-02 alpine3.20)
  • php8.4.1_node23.3.0, php8.4.1_withoutNodejs (2024-12-02 alpine3.20) Note: PHP version is 8.4 now!
  • php8.3.13_node22.11.0, php8.3.13_withoutNodejs (2024-11-04 alpine3.20)
  • php8.3.12_node22.9.0, php8.3.12_withoutNodejs (2024-10-08 alpine3.20)
  • php8.3.11_node22.7.0, php8.3.11_withoutNodejs (2024-09-03 alpine3.20)
  • php8.3.10_node22.5.1, php8.3.10_withoutNodejs (2024-08-05 alpine3.20)
  • php8.3.8_node22.4.0, php8.3.8_withoutNodejs (2024-07-04 alpine3.20)
  • php8.3.7_node22.2.0, php8.3.7_withoutNodejs (2024-06-03 alpine3.19)
  • php8.3.6_node22.1.0, php8.3.6_withoutNodejs (2024-05-06 alpine3.19)
  • php8.3.4_node21.7.2, php8.3.4_withoutNodejs (2024-04-07 alpine3.19)
  • php8.3.3_node21.6.2, php8.3.3_withoutNodejs (2024-03-04 alpine3.19)
  • php8.3.2_node21.6.1, php8.3.2_withoutNodejs (2024-02-10 alpine3.19)
  • php8.3.1_node21.5.0, php8.3.1_withoutNodejs (2024-01-03 alpine3.18)
  • php8.3.0_node21.3.0, php8.3.0_withoutNodejs (2023-12-04 alpine3.18) Note: PHP version is 8.3 now!
  • php8.2.12_node21.1.0, php8.2.12_withoutNodejs (2023-11-03 alpine3.18)
  • php8.2.11_node20.8.0, php8.2.11_withoutNodejs (2023-10-09 alpine3.18)
  • php8.2.10_node20.6.0, php8.2.10_withoutNodejs (2023-09-08 alpine3.18)
  • php8.2.8_node20.5.0, php8.2.8_withoutNodejs (2023-08-03 alpine3.17)
  • php8.2.7_node20.3.1, php8.2.7_withoutNodejs (2023-07-03 alpine3.17)
  • php8.2.6_node20.2.0, php8.2.6_withoutNodejs (2023-06-07 alpine3.17)
  • php8.2.5_node20.1.0, php8.2.5_withoutNodejs (2023-05-08 alpine3.17)
  • php8.2.4_node19.8.1, php8.2.4_withoutNodejs (2023-04-10 alpine3.17)
  • php8.2.3_node19.7.0, php8.2.3_withoutNodejs (2023-03-06 alpine3.17)
  • php8.2.2_node19.6.0, php8.2.2_withoutNodejs (2023-02-06 alpine3.17)
  • php8.2.0_node19.3.0, php8.2.0_withoutNodejs (2023-01-05 alpine3.17) Note: PHP version is 8.2 now!
  • php8.1.13_node19.2.0, php8.1.13_withoutNodejs (2022-12-06 alpine3.16)
  • php8.1.12_node19.0.0, php8.1.12_withoutNodejs (2022-11-07 alpine3.16)
  • php8.1.11_node18.10.0 (2022-10-13 alpine3.16)
  • php8.1.10_node18.8.0 (2022-09-06 alpine3.16)
  • php8.1.9_node18.7.0 (2022-08-11 alpine3.16)
  • php8.1.8_node18.4.0 (2022-07-08 alpine3.16)
  • php8.1.6_node18.2.0 (2022-06-06 alpine3.15)
  • php8.1.5_node18.1.0 (2022-05-07)
  • php8.1.4_node17.8 (2022-04-10)
  • php8.1.3_node17 (2022-03-07)
  • php8.0.13_node17 (2022-03-07)
  • php8_node15 (2022-03-07)

NOTE If you are upgrading from PHP 8.0 to 8.1, 8.1 to 8.2, 8.2 to 8.3, 8.3 to 8.4 or 8.4 to 8.5, you may need to run composer update to upgrade php packages, because some packages under 8.0/8.1/8.2/8.3 are not supported in 8.1/8.2/8.3/8.4 .

# php -v
PHP 8.5.1 (cli) (built: Jan  9 2026 22:35:39) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.1, Copyright (c), by Zend Technologies

# node -v
v25.2.1

# nginx -v
nginx version: nginx/1.29.4

PHP Modules

In this image it contains following PHP modules:

How to use

For example, use this docker image to deploy a Laravel 11 project.

Dockerfile:

You may check start.sh for more information about what it can do.

Develop with this image

Another example to develop with this image for a Laravel 11 project, you may modify the docker-compose.yml of your project.

Here we only modified fields image and environment under services -> laravel.test.

Make sure you have correct environment parameters set:

Add extra PHP modules

You may use this image as the base image to build your own. For example, to add mongodb module in images before php8.2.8_node20.5.0:

  • Create a Dockerfile
FROM tangramor/nginx-php8-fpm:php8.2.7_node20.3.1

RUN apk add --no-cache --update --virtual .phpize-deps $PHPIZE_DEPS \
    && apk add --no-cache --update --virtual .all-deps $PHP_MODULE_DEPS \
    && pecl install mongodb \
    && docker-php-ext-enable mongodb \
    && rm -rf /tmp/pear \
    && apk del .all-deps .phpize-deps \
    && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
  • Build image
docker build -t my-nginx-php8-fpm .
0 likes
7 replies
bugsysha's avatar

I guess it would be better to place this in tips channel.

tangramor's avatar

I have updated the image to support php8.1...

tangramor's avatar

Now added PHP 8.1.4 + Node 17.8.0 tag

  • latest, php8.1.4_node17.8 (2022-04-10)
  • php8.1.3_node17 (2022-03-07)
  • php8.0.13_node17 (2022-03-07)
  • php8_node15 (2022-03-07)
1 like
hooman-pro's avatar

what a bout queue and schedule? is this image include supervisor?

tangramor's avatar

@hooman-pro you may check the Dockerfile, script and config files in github, and I think you can add related modules by yourself. It uses supervisor.

tangramor's avatar

Since php8.1.8_node18.4.0, PHP amqp module is added.

Tags:

  • latest, php8.1.8_node18.4.0 (2022-07-08 alpine3.16)
  • php8.1.6_node18.2.0 (2022-06-06 alpine3.15)
  • php8.1.5_node18.1.0 (2022-05-07)
  • php8.1.4_node17.8 (2022-04-10)
  • php8.1.3_node17 (2022-03-07)
  • php8.0.13_node17 (2022-03-07)
  • php8_node15 (2022-03-07)
1 like
tangramor's avatar

Upgrade to php8.2.0_node19.3.0 If you are upgrading from PHP 8.1 to 8.2, you may need to run composer update to upgrade php packages, because some packages under 8.1 are not supported in 8.2

Please or to participate in this conversation.