Sign inSign up

sparkpos/docker-nginx-php

By sparkpos

•Updated about 3 years ago

sparkpos nginx php

Image
1

100K+

sparkpos/docker-nginx-php repository overview

⁠Overview

Build nginx+php-fpm in one docker image, with predifined nginx config for Drupal, Laravel etc.

⁠Usage
### quick drupal running.
docker run -d -p 8080:80 -v /path-to-your-drupal-code:/var/www/html -e APP=drupal sparkpos/docker-nginx-php:7.4-alpine

### quick drupal running.
docker run -d -p 8080:80 -v /path-to-your-drupal-code:/var/www/html -e APP=drupal -e DRUPAL_WEB_ROOT=web sparkpos/docker-nginx-php:7.4-alpine

### quick laravel running.
docker run -d -p 8080:80 -v /path-to-your-laravel-code:/var/www/html -e APP=laravel sparkpos/docker-nginx-php:7.4-alpine
⁠docker-compose example

see docker-compose.yml⁠

⁠environment
⁠General
NameDescription
APPthe type of app, current allowed value: drupal, laravel
DRUPAL_WEB_ROOTfor drupal project that initialized via compose, the code is located in "web". using this flag to indicate.
HTTP_HEADER_X_FRAME_OPTIONSX-Frame-Options, default value: SAMEORIGIN; see here⁠
HTTP_HEADER_X_CONTENT_SECURITY_POLICYContent-Security-Policy, default value: "default-src 'self';";see here⁠
MAX_FILE_UPLOAD_SIZEModify the upload file size, this will change both the nginx & php config. default value: 32M
⁠php & php-fpm
NameDesciptionDefault Value
NGINX_WORKER_PROCESSESnginx worker_processes, allowed value: auto, 1, 2, 3 ...|auto
PHP_MEM_LIMITThe php memory limit in php.ini.1024M
PHP_FPM_PMmodify the php-fpm processing type, allowed values: static, ondemand, dynamicdynamic
PHP_FPM_PM_MAX_CHILDRENmodify the pm.max_children for php-fpm config.30
PHP_FPM_PM_PROCESS_IDLE_TIMEOUTmodify the pm.process_idle_timeout. this is availiable when pm = ondemand10s
PHP_FPM_PM_START_SERVERSmodify the pm.start_servers. this is availiable when pm = dynamic10
PHP_FPM_PM_MIN_SPARE_SERVERSmodify the pm.min_spare_servers. this is availiable when pm = dynamic5
PHP_FPM_PM_MAX_SPARE_SERVERSmodify the pm.max_spare_servers. this is availiable when pm = dynamic10
PHP_FPM_STATUS_ENABLEenable the fpm status path or not. the path is /status
TIMEOUTmodify the nginx.conf:proxy_read_timeout and php.ini:max_execution_time30
⁠cron support
  • provide default drupal cron, run daily.
  • for custom cron command, using docker volumes for different perpose
  • check here⁠ for more details.
/etc/periodic/min
/etc/periodic/15min
/etc/periodic/hourly
/etc/periodic/daily
/etc/periodic/weekly
/etc/periodic/monthly

Tag summary

Content type

Image

Digest

sha256:8de9d747a…

Size

228.9 MB

Last updated

about 3 years ago

docker pull sparkpos/docker-nginx-php:8.2-alpine