Sign inSign up

smujaddid/nginx-php-fpm

By smujaddid

•Updated almost 5 years ago

Derived from richarvey/nginx-php-fpm

Image
0

3.0K

smujaddid/nginx-php-fpm repository overview

⁠Overview

This image unified both NGINX and PHP-FPM in one container with the ability to pull source code from git to serve a website. Alpine based PHP-FPM is used as base image, NGINX installed by using the same script as NGINX Dockerfile on its GitHub repository.

⁠Versions
  • latest, php-7.4-nginx-1.18
  • preview, php-8.0-nginx-1.19
⁠Installed PHP Extensions

Other than default extensions that is installed in the php base image, the following extensions are enabled:

  • bcmath
  • exif
  • gd
  • gmp
  • intl
  • mysqli
  • opcache
  • pdo_mysql
  • pdo_pgsql
  • pgsql
  • redis
  • soap
  • xsl
  • zip
⁠Installed Alpine Packages
  • bash
  • ca-certificates
  • curl
  • git
  • jq
  • libcurl
  • nodejs
  • npm
  • openssh-client
  • su-exec
  • supervisor
  • tzdata
  • wget
⁠Installed Tools
  • Wordpres CLI 2.x
  • Composer 2.x

⁠Usage

Pull from docker

docker pull smujaddid/nginx-php-fpm:latest

Run the container

docker run -d smujaddid/nginx-php-fpm:latest

⁠Available Configuration

KeyDescription
GIT_REPOURL to your repository without the http:// or https://
GIT_BRANCHThe default branch to be pulled
GIT_TAGThe tag that will be checked out
GIT_COMMITThe commit that will be checked out
GIT_EMAILEmail for git
GIT_NAMEName for git
GIT_USERNAMEGit username
GIT_PERSONAL_TOKENPersonal access token for accessing the git repository
REMOVE_FILESSet to 1 to remove files before pulling source code
SKIP_COMPOSERSet to 1 to skip running composer automatically when composer.lock detected
SKIP_LARAVEL_ARTISANSet to 1 to skip running laravel artisan automatically when artisan detected
SKIP_NPMSet to 1 to skip running npm automatically when package-lock.json detected
NPM_RUNCall npm run prod or npm run dev for node projects
APPLICATION_ENVSet the image as either production or development environment. This will affect composer --dev and npm run dev
RUN_SCRIPTSSet to 1 to allow scripts in ./script/ folder to be running at the end of setup
PHP_CATCHALLSet to 1 to allow serve Laravel by directing all query to index.php
SHOW_NGINX_HEADERSSet to 1 to show nginx version. Default 0.
REAL_IP_HEADERSet to 1 to enable Real IP support
REAL_IP_FROMSet CIDR block for Real IP
PHP_MEM_LIMITSet PHP memory_limit. Default 128.
PHP_POST_MAX_SIZESet PHP post_max_size. Default 100.
PHP_UPLOAD_MAX_FILESIZESet PHP upload_max_filesize. Default 100.
PHP_MAX_EXECUTION_TIMESet PHP max_execution_time. Default 600.
PUIDSet user id for PHP user. Source code will be owned by this user.
GUIDSet group id for PHP user. Source code will be assigned to this user group.
SKIP_CHOWNDo not change ownership of source code
WEBROOTChange the default webroot (/var/www/html) in nginx host configuration
RUN_LARAVEL_WORKERSet to 1 to run Laravel queue worker automatically using supervisord
RUN_LARAVEL_WEBSOCKETSSet to 1 to run Laravel websockets automatically using supervisord. Requires 'composer install beyondcode/laravel-websockets'
RUN_LARAVEL_SCHEDULERSet to 1 to run Laravel scheduler automatically using supervisord

Tag summary

Content type

Image

Digest

Size

105.2 MB

Last updated

almost 5 years ago

docker pull smujaddid/nginx-php-fpm