Sign inSign up

jurriaanr/php

By jurriaanr

•Updated 26 days ago

PHP image for personal projects

Image
Languages & frameworks
0

2.4K

jurriaanr/php repository overview

Based on https://hub.docker.com/_/php/⁠

Using:

Changelog: *

PHP-FPM based containers, adding PHP extensions that we often use:

Support for locales:

  • en_GB.UTF-8
  • en_US.UTF-8
  • nl_NL.UTF-8
  • de_DE.UTF-8
  • fr_FR.UTF-8
  • es_ES.UTF-8

Enabled default PHP extensions:

  • gd
  • exif
  • mcrypt
  • zip
  • mbstring
  • intl
  • bcmath
  • curl
  • pdo_mysql
  • xsl
  • soap
  • mysqli
  • simplexml
  • sockets
  • xmlrpc
  • opcache
  • mysql
  • ldap
  • memcache
  • memcached
  • redis
  • imagick

⁠Extra software

Used for apps that have no separated front-end (like react), we have added nodejs so these can also be build inside the same container:

  • nodejs
  • npm
  • yarn
  • pm2

⁠EXAMPLE docker-compose.yml, using the VIRTUAL_HOST tag and the jwilder-proxy:

version: '3'
services:
    web:
        image: jurriaanr/apache:2.4-fpm
        restart: always
        network_mode: "bridge"
        environment:
            - "VIRTUAL_HOST=${DOCKER_VHOST}"
        links:
            - php
        depends_on:
            - php
        volumes:
            - .:/app/:cached

    php:
        image: jurriaanr/php:8.3-fpm
        restart: always
        network_mode: "bridge"
        volumes:
            - .:/app/:cached
        environment:
            - "PHP_SESSION_SAVE_HANDLER=redis"
            - "PHP_SESSION_SAVE_PATH=tcp://redis:6379"
        links:
            - redis
        depends_on:
            - redis

    redis:
        image: redis:alpine
        restart: always
        network_mode: "bridge"

⁠DEFAULT VALUES:

These values can be overwritten in your .env or "environment"-tag in your docker-compose.yml:

PHP_MAX_EXECUTION_TIME=120
PHP_MEMORY_LIMIT=256M
PHP_UPLOAD_LIMIT=8M
PHP_OPCACHE_LIMIT=64M
PHP_OPCACHE_REVALIDATE=2
PHP_SESSION_SAVE_HANDLER=files
PHP_SESSION_SAVE_PATH=""
PHP_SMTP_HOST=localhost
PHP_MAX_INPUT_VARS=1000

For example, you can add a redis container and change the redis-settings in your PHP-container:

version: '3'
services:
    php:
        image: jurriaanr/php:8.3-fpm
        network_mode: "bridge"
        environment:
            - "PHP_SESSION_SAVE_HANDLER=redis"
            - "PHP_SESSION_SAVE_PATH=tcp://redis:6379"
        links:
            - redis
        depends_on:
            - redis

    redis:
        image: redis:alpine
        network_mode: "bridge"

For development, set PHP_OPCACHE_REVALIDATE to "0", the default value "2" is somewhat of a tradeoff.

Tag summary

Content type

Image

Digest

sha256:475924c85…

Size

468.4 MB

Last updated

26 days ago

docker pull jurriaanr/php