GithubHelp home page GithubHelp logo

ifa6 / docker-alpine-php-fpm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yavin/docker-alpine-php-fpm

0.0 3.0 0.0 6 KB

Docker image for php-fpm based on alpine linux that makes it small

docker-alpine-php-fpm's Introduction

Docker image for php-fpm

Tags:

Image for php-fpm. It is based on Alpine linux and thats why it is very small (~60MB). Included extensions are required for Symfony framework 3+, that's why it should also work with other applications.

  • PHP 7.0.3

Running

docker run --rm -p 9000:9000 -v /path/of/application:/app yavin/alpine-php-fpm:7.0

Fallowing configuration allow to connect to this FPM setup:

server {
    # here some other configuration...

    location ~ \.php(/|$) {
        include       fastcgi_params;
        fastcgi_param DOCUMENT_ROOT   /app/web;
        fastcgi_param SCRIPT_FILENAME /app/web$fastcgi_script_name;
        fastcgi_pass  fpm-host-name:9000;
    }
}

Please note the path that is passed to FPM and compare it with the docker run command. Above example assume that the /app/web is the "public" folder of your app. If paths in PFM container are the same as in Nginx you can replace it with $realpath_root nginx variable.

Custom php.ini settings

Create Dockerfile file with fallowing content and php.ini file with desired settings (look at php.ini file in this repository)

FROM yavin/alpine-php-fpm:7.0
COPY php.ini /etc/php7/conf.d/50-setting.ini

And then

docker build -t my-php-fpm .
docker run --rm -p 9000:9000 -v /path/of/application:/app my-php-fpm:latest

Change FPM parameters

Copy php-fpm.conf and modify. You will probably want to change process manager settings:

; ...
pm.max_children = 10
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 5
; ...

and build your image:

FROM yavin/alpine-php-fpm:7.0
COPY php-fpm.conf /etc/php7/php-fpm.conf

Add extension that you need

FROM yavin/alpine-php-fpm:7.0
RUN apk --update add php7-zip && rm -rf /var/cache/apk/*

PHP extensions included:

  • fpm
  • session
  • opcache
  • pdo_mysql
  • mysqlnd
  • json
  • xml
  • curl
  • gd
  • intl
  • pdo
  • mbstring
  • dom
  • ctype
  • posix
All php7 available packages in repository
php7-intl
php7-openssl
php7-dba
php7-sqlite3
php7-pear
php7-phpdbg
php7-litespeed
php7-gmp
php7-pdo_mysql
php7-pcntl
php7-common
php7-xsl
php7-fpm
php7-mysqlnd
php7-enchant
php7-pspell
php7-snmp
php7-doc
php7-mbstring
php7-dev
php7-xmlrpc
php7-embed
php7-xmlreader
php7-pdo_sqlite
php7-exif
php7-opcache
php7-ldap
php7-posix
php7-session
php7-gd
php7-gettext
php7-json
php7-xml
php7
php7-sysvshm
php7-curl
php7-shmop
php7-odbc
php7-phar
php7-pdo_pgsql
php7-imap
php7-pdo_dblib
php7-pgsql
php7-pdo_odbc
php7-zip
php7-apache2
php7-cgi
php7-ctype
php7-mcrypt
php7-readline
php7-wddx
php7-bcmath
php7-calendar
php7-tidy
php7-dom
php7-sockets
php7-soap
php7-sysvmsg
php7-zlib
php7-ftp
php7-sysvsem
php7-pdo
php7-bz2
php7-mysqli
Licence

MIT

docker-alpine-php-fpm's People

Contributors

yavin avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.