Sign inSign up

premiummedia/php-light

By premiummedia

•Updated over 4 years ago

PHP and Composer

Image
0

671

premiummedia/php-light repository overview

⁠Büro für Erfrischung Docker Container

From premiummedia Bitbucket⁠


⁠Update php Versions
  • Clone repo
  • Update in Dockerfile⁠ the php version
  • Build container on your local machine for testing
  • If it works, tag it with the correct php versions and push the tag to Bitbucket repository
  • Control on Docker Hub⁠ the progress of the deployment

⁠Basic php yml configuration

add the following to your docker-compose.yml

version: "3"
services:
  php:
    image: premiummedia/php-light:${PHP_VERSION}
    container_name: <nice-and-clean-container-name>
    networks:
      - <nice-and-clean-network-name>
    restart: always
    working_dir: /var/www/html
    depends_on:
      - <name-of-service>

⁠Optional Files

⁠general.ini

add the following to .docker/php/config/general.ini

error_log=/tmp/log/php/<php-version>/error.log
date.timezone = Europe/Zurich
sendmail_path = /usr/bin/mhsendmail --smtp-addr mailhog:1025
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
memory_limit = 256M
max_input_time = 60
max_execution_time = 120
upload_max_filesize = 90M
post_max_size = 90M
realpath_cache_size = 4096K
realpath_cache_ttl = 120
output_buffering = 4096
display_errors = 0
log_errors = 1
short_open_tag = 0

and the following to docker-compose.yml

...
volumes:
  ...
   - '.docker/php/config/conf/general.ini:/etc/php/<php-version>/fpm/conf.d/99-general.ini'
   - './.docker/php/logs/php:/tmp/log/php/<php-version>'
...

⁠opcache.ini

add the following to .docker/php/config/opcache.ini

[opcache]
opcache.enable=0
opcache.revalidate_freq=0
opcache.validate_timestamps=0
opcache.max_accelerated_files=20000
opcache.memory_consumption=512
opcache.max_wasted_percentage=10
opcache.interned_strings_buffer=64
opcache.fast_shutdown=1

and the following to docker-compose.yml

...yaml
volumes:
  ...
  - '.docker/php/config/conf/opcache.ini:/etc/php/<php-version>/fpm/conf.d/99-opcache.ini'
...

⁠xdebug.ini

add the following to .docker/php/config/xdebug.ini

[xdebug]
xdebug.remote_autostart = 1
xdebug.default_enable = 1
xdebug.remote_port = 9001
xdebug.remote_host = %host_ip%
xdebug.remote_connect_back = 1
xdebug.remote_enable = 1
xdebug.idekey = PHPSTORM

xdebug.remote_log = /tmp/log/xdebug/xdebug.log

and the following to docker-compose.yml

...
volumes:
  ...
   - '.docker/php/config/conf/xdebug.ini:/etc/php/<php-version>>/fpm/conf.d/99-xdebug.ini'
   - './.docker/php/logs/xdebug:/tmp/log/xdebug'
...

Tag summary

Content type

Image

Digest

Size

168 MB

Last updated

over 6 years ago

docker pull premiummedia/php-light