Code Monkey home page Code Monkey logo

docker-php's Introduction

CI/CD

Description

Minimal PHP Docker image focused on Laravel applications. It's use is intended for kool.dev, but can fit in any other PHP use-case.

The images with Nginx include h5bp/server-configs-nginx with a hand picked set of configuration active by default. So if you want to change or add a new server configuration you can include h5bp/... as you see fit.

Usage

Simplest example:

asciicast

Available Tags

The image built is kooldev/php which has a bunch of tags available:

8.0

7.4

7.3

7.2

7.1

More flavours

We can always extend these images to suit them to our current use case. For example, we have a few extensions for specific use cases:

Environment Variables

Variable Default Value Description
ASUSER 0 Changes the user id that executes the commands
UID 0 Changes the user id that executes the commands (ignored if ASUSER is provided)
COMPOSER_ALLOW_SUPERUSER 1 Allows composer to run with super user
COMPOSER_MEMORY_LIMIT -1 Changes composer memory limit
ENABLE_XDEBUG false Enables the Xdebug extension
PHP_DATE_TIMEZONE UTC Changes timezone used by date/time functions
PHP_MEMORY_LIMIT 256M Changes PHP memory limit
PHP_MAX_INPUT_VARS 1000ย  Changes how many input variables may be accepted on PHP
PHP_UPLOAD_MAX_FILESIZE 25M Changes PHP maximum size of an uploaded file
PHP_POST_MAX_SIZE 25M Changes PHP max size of post data allowed
PHP_MAX_EXECUTION_TIME 30 Changes PHP maximum time is allowed to run a script
PHP_FPM_LISTEN 9000 Changes the PORT address of the FastCGI requests
PHP_FPM_MAX_CHILDREN 10 Changes the number of child processes to be used on FPM
PHP_FPM_REQUEST_TERMINATE_TIMEOUT 60 Changes FPM timeout to serve a single request

NGINX

Variable Default Value Description
NGINX_LISTEN 80 Changes the PORT address
NGINX_ROOT /app/public Changes NGINX root directive
NGINX_INDEX index.php Changes the index directive
NGINX_CLIENT_MAX_BODY_SIZE 25M Changes maximum allowed size of the client request body
NGINX_PHP_FPM unix:/run/php-fpm.sock Changes the address of a FastCGI server
NGINX_FASTCGI_READ_TIMEOUT 60s Changes a timeout for reading a response from the FastCGI server
NGINX_FASTCGI_BUFFERS 8 8k Changes the number and size of the buffers used for reading a response
NGINX_FASTCGI_BUFFER_SIZE 16k Changes the size of the buffer used for reading the first part of the response received

Usage

With docker run:

docker run -it --rm kooldev/php:7.4 php -v

With environment variables:

docker run -it --rm -e ENABLE_XDEBUG=true kooldev/php:7.4-prod php -v

With docker-compose.yml:

app:
  image: kooldev/php:7.4
  ports:
    - "9773:9773"
  volumes:
    - ".:/app:cached"
    - "$HOME/.ssh/id_rsa:/home/developer/.ssh/id_rsa:cached"
  environment:
    ASUSER: "${$UID}"

Contributing

Update images with templates

You should change fwd-template.json for configuration and template folder for the actual base templates.

After any changes, we need to run kool run template to parse the templates and generate all versions folder/files.

License

The MIT License (MIT). Please see License File for more information.

docker-php's People

Contributors

dbpolito avatar dependabot[bot] avatar fabriciojs avatar fbrissi avatar indiegenus avatar wesleyhf avatar

Stargazers

 avatar

Watchers

 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.