项目作者: eaudeweb

项目描述 :
Custom PHP-FPM image for PHP/Drupal projects
高级语言: Dockerfile
项目地址: git://github.com/eaudeweb/docker.php-fpm.git
创建时间: 2018-02-08T16:21:41Z
项目社区:https://github.com/eaudeweb/docker.php-fpm

开源协议:

下载


Docker image for PHP-FPM

To override the php.ini or www.conf (PHP-FPM default pool configuration), you can retrieve the proper file from each directory, customize and mount its. Example docker-compose.yml:

  1. version: '2.0'
  2. services:
  3. php71:
  4. image: eaudeweb/php-fpm:7.1-1.0.1
  5. volumes:
  6. - ./config/custom-php.ini:/usr/local/etc/php/php.ini
  7. - ./config/custom-www.conf:/usr/local/etc/php-fpm.d/www.conf

Installed tools

  • PHP extensions: gd, gettext, imap, intl, ldap, memcached, mysqli, opcache, pdo_mysql, sockets, xmlrpc, zip
  • Composer - 1.6.5
  • Drush 8.1.16 - https://www.drush.org/
  • Drupal Console 8.1.16 - https://drupalconsole.com/
  • SSMTP - sendmail replacement, use with eaudeweb/mailtrap / external SMTP
  • Command line utilities: git vim wget unzip nodejs grunt

Configuring email

By default all the mail is routed to the mail container and does not allow overriding the FROM header. To enable this you can create a custom configuration file and mount it as volume in /etc/ssmtp/ssmtp.conf:

  1. #
  2. # Config file for sSMTP sendmail
  3. #
  4. # The person who gets all mail for userids < 1000
  5. # Make this empty to disable rewriting.
  6. root=postmaster
  7. # The place where the mail goes. The actual machine name is required no
  8. # MX records are consulted. Commonly mailhosts are named mail.domain.com
  9. mailhub=mail
  10. # Where will the mail seem to come from?
  11. rewriteDomain=domain.com
  12. # The full hostname
  13. hostname=www.domain.com
  14. # Are users allowed to set their own From: address?
  15. # YES - Allow the user to specify their own From: address
  16. # NO - Use the system generated From: address
  17. FromLineOverride=YES

and in docker-compose.override.yml

  1. php:
  2. container_name: prj_php
  3. restart: always
  4. volumes:
  5. - ./ssmtp.conf:/etc/ssmtp/ssmtp.conf

Build images on local

  1. cd 5.6
  2. docker build -t eaudeweb/php-fpm:5.6-1.0.2 .
  3. docker run --name test56 --rm eaudeweb/php-fpm:5.6-1.0.2
  4. docker exec -ti test56 bash
  5. cd 7.1
  6. docker build -t eaudeweb/php-fpm:7.1-1.0.2 .
  7. docker run --name test71 --rm eaudeweb/php-fpm:7.1-1.0.2
  8. docker exec -ti test71 bash
  9. cd 7.2
  10. docker build -t eaudeweb/php-fpm:7.2-1.0.2 .
  11. docker run --name test72 --rm eaudeweb/php-fpm:7.2-1.0.2
  12. docker exec -ti test72 bash