gists/php

By gists

Updated 9 days ago

PHP (fpm) based on Alpine

Image

1M+

Environment:

EnvironmentVariableDefault value
MEMORY_LIMITmemory_limit256M
MAX_EXECUTION_TIMEmax_execution_time60
UPLOAD_MAX_FILESIZEupload_max_filesize64M
MAX_FILE_UPLOADSmax_file_uploads20
POST_MAX_SIZEpost_max_size64M
MAX_INPUT_VARSmax_input_vars4000
DATE_TIMEZONEdate.timezoneAsia/Shanghai
PM_MAX_CHILDRENpm.max_children6
PM_START_SERVERSpm.start_servers4
PM_MIN_SPARE_SERVERSpm.min_spare_servers2
PM_MAX_SPARE_SERVERSpm.max_spare_servers6
UIDuser id101
GIDgroup id101

Volume:

  • /var/www

Custom usage:

docker run \
    -d \
    --name php-fpm \
    -v /path/www:/var/www \
    -e UPLOAD_MAX_FILESIZE=128M
    gists/php

Compose example:

version: '3'

services:
    php:
        container_name: php
        image: gists/php
        volumes:
            - /path/www:/var/www
            - phpsocket:/run/php
        environment:
            UPLOAD_MAX_FILESIZE=128M
        restart: always
    nginx:
        container_name: nginx
        image: nginx:stable-alpine
        ports:
            - "80:80"
            - "443:443"
        volumes:
            - /path/www:/var/www
            - phpsocket:/run/php
        depends_on:
            - php
        restart: always
volumes:
    phpsocket:

nginx configuration with php-fpm

with php8-fpm on gists/php

fastcgi_pass    unix:/run/php/php8-fpm.sock;

with php5-fpm on gists/php:5

fastcgi_pass    unix:/run/php/php5-fpm.sock;

Docker Pull Command

docker pull gists/php