Sign inSign up

premiummedia/php

By premiummedia

•Updated over 7 years ago

PHP, Apache and Composer

Image
2

663

premiummedia/php repository overview

From premiummedia Bitbucket⁠


⁠How To Use

⁠Project with public Directory as Web Root

add the following to your docker-compose.yml

version: "3"
services:
  php:
    image: premiummedia/php:${PHP_VERSION}
    ports:
      - '${APACHE_PORT_HOST}:80'
    restart: always
    working_dir: /var/www/html
    volumes:
      - './:/var/www/html'

⁠Project without public Directory as Web Root

add the following to your docker-compose.yml

version: "3"
services:
  php:
    image: premiummedia/php:${PHP_VERSION}
    ports:
      - '${APACHE_PORT_HOST}:80'
    restart: always
    working_dir: /var/www/html/public
    volumes:
      - './:/var/www/html/public'

⁠Optional Files

⁠general.ini

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

error_log=/tmp/log/php/error.log
date.timezone=Europe/Zurich

and the following to docker-compose.yml

...
volumes:
  ...
   - './.docker/php/config/conf/general.ini:/usr/local/etc/php/conf.d/general.ini'
   - './.docker/php/logs/php:/tmp/log/php'
...

⁠opcache.ini

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

opcache.memory_consumption=128;
opcache.interned_strings_buffer=8;
opcache.max_accelerated_files=4000;
opcache.revalidate_freq=2;
opcache.fast_shutdown=1;
opcache.enable_cli=1;
opcache.enable=1;

and the following to docker-compose.yml

...yaml
volumes:
  ...
  - './.docker/php/config/conf/opcache.ini:/usr/local/etc/php/conf.d/opcache.ini'
...

⁠xdebug.ini

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

; Set your local ip here -> host ip
xdebug.remote_host=192.168.25.137
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=0

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

and the following to docker-compose.yml

...
volumes:
  ...
   - './.docker/php/config/conf/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini'
   - './.docker/php/logs/xdebug:/tmp/log/xdebug'
...

Tag summary

Content type

Image

Digest

Size

258.6 MB

Last updated

over 8 years ago

docker pull premiummedia/php