http://xyz.cinc.biz/2014/09/gmail-passw ... erver.html
https://binfalse.de/2016/11/25/mail-sup ... s-php-fpm/
Dockerfile
代碼: 選擇全部
FROM php:5.6-fpm
RUN docker-php-ext-install -j$(nproc) pdo_mysql
RUN docker-php-ext-install -j$(nproc) mbstring
RUN docker-php-ext-install -j$(nproc) tokenizer
RUN docker-php-ext-install -j$(nproc) mysqli
RUN docker-php-ext-install -j$(nproc) mysql
RUN apt-get update && \
apt-get install -y libgnutls-openssl27 libmcrypt-dev libmcrypt4 ssmtp && \
apt-get clean
RUN docker-php-ext-configure mcrypt && docker-php-ext-install -j$(nproc) mcrypt
RUN curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer
RUN echo 'sendmail_path = "/usr/sbin/ssmtp -t"' > /usr/local/etc/php/conf.d/mail.ini
代碼: 選擇全部
php56:
container_name: php56
restart: always
image: myphp:5.6-fpm
ports:
- "25:25"
links:
- mariadb:db
environment:
- DB_HOST=mariadb
volumes:
- /home/Dockers/auto/php56.ini:/usr/local/etc/php/php.ini:ro
- /home/Dockers/auto/ssmtp.conf:/etc/ssmtp/ssmtp.conf:ro
- /home/Dockers/auto/revaliases:/etc/ssmtp/revaliases:ro
volumes_from:
- www_data
working_dir:
/var/www/html
代碼: 選擇全部
AuthUser=# 寄件者帳號
AuthPass=# 寄件者密碼
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES