Giter VIP home page Giter VIP logo

docker-php's Introduction

PHP base docker image

...with integration examples, development support and production-ready focus.

It includes PHP application container (ready for production use, with development tools available) - based on Debian, as well as documentation and examples for integration with other components.

This master branch includes only documentation and examples. For docker container implementation, see branches (each docker release tag corresponds to seperate branch of this repository).

Versions, branches

Branch Docker image tags
7.4-bullseye korekontrol/php:7.4 korekontrol/php:7.4-bullseye
7.3-buster korekontrol/php:7.3 korekontrol/php:7.3-buster

Images are published daily to docker hub repository

Motivation

There are many examples which explain how to build PHP containers with Docker. There are also official PHP docker repostories. However, during our experience with customer projects at KoreKontrol, we found that most of the examples cover only basic cases - what is needed in real, production hosting is often much more complicated.

Our goals:

  • Optimise container sizes. Don't include unneeded crap, like compilers, nodejs, development libraries etc. Small containers are must-have for quick builds and deployments.
  • Provide daily images, with latest patches and minor versions.
  • Include opcache, xdebug and composer.
  • Integrate with modern frameworks.
  • Support node.js frontend builds.
  • Include asset files in seperate NginX container, without volumes for sharing files.

Examples

  • hello-world - really basic PHP web application, with composer and static assets

Reference

Configuration

Following environmental variables are used by the PHP container:

Variable Default value Comments
PHP_MEMORY_LIMIT 256m Per-process memory limit
PHP_OPCACHE_ENABLE 1 Enable/disable opcache extension
PHP_OPCACHE_MEMORY_CONSUMPTION 64 Per-container opcache memory size (in MB)
PHP_OPCACHE_REVALIDATE_FREQ 2 Ignored if timestamp validation is not enabled
PHP_OPCACHE_VALIDATE_TIMESTAMPS 0 Set it to 1 on development environment
PHP_XDEBUG_ENABLE 0 Enable/disable xdebug module; setting it to 1 will disable opcache. Don't use on production.

Credits

Created by Marek Obuchowicz from KoreKontrol

License

MIT

docker-php's People

Contributors

marek-obuchowicz avatar

Stargazers

 avatar

Watchers

 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.