Adjust prod Docker

This commit is contained in:
cytopia
2018-02-27 23:38:09 +01:00
parent f5491d91fc
commit 6d35b06c45
33 changed files with 914 additions and 470 deletions

View File

@@ -1,4 +1,4 @@
# Auto-generated via Ansible
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.4-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -35,19 +35,6 @@ RUN set -x \
###
### Configure
###
RUN set -x \
&& { \
echo "[mail function]"; \
echo "sendmail_path = /usr/sbin/sendmail -t -i"; \
echo ";mail.force_extra_parameters ="; \
echo "mail.add_x_header = On"; \
echo "mail.log = /var/log/php/mail.log"; \
} > /usr/local/etc/php/conf.d/devilbox-mail.ini
###
### Verify
###

View File

@@ -1,4 +1,4 @@
# Auto-generated via Ansible
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.5-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -35,19 +35,6 @@ RUN set -x \
###
### Configure
###
RUN set -x \
&& { \
echo "[mail function]"; \
echo "sendmail_path = /usr/sbin/sendmail -t -i"; \
echo ";mail.force_extra_parameters ="; \
echo "mail.add_x_header = On"; \
echo "mail.log = /var/log/php/mail.log"; \
} > /usr/local/etc/php/conf.d/devilbox-mail.ini
###
### Verify
###

View File

@@ -1,4 +1,4 @@
# Auto-generated via Ansible
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.6-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -35,19 +35,6 @@ RUN set -x \
###
### Configure
###
RUN set -x \
&& { \
echo "[mail function]"; \
echo "sendmail_path = /usr/sbin/sendmail -t -i"; \
echo ";mail.force_extra_parameters ="; \
echo "mail.add_x_header = On"; \
echo "mail.log = /var/log/php/mail.log"; \
} > /usr/local/etc/php/conf.d/devilbox-mail.ini
###
### Verify
###

View File

@@ -1,4 +1,4 @@
# Auto-generated via Ansible
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.0-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -35,19 +35,6 @@ RUN set -x \
###
### Configure
###
RUN set -x \
&& { \
echo "[mail function]"; \
echo "sendmail_path = /usr/sbin/sendmail -t -i"; \
echo ";mail.force_extra_parameters ="; \
echo "mail.add_x_header = On"; \
echo "mail.log = /var/log/php/mail.log"; \
} > /usr/local/etc/php/conf.d/devilbox-mail.ini
###
### Verify
###

View File

@@ -1,4 +1,4 @@
# Auto-generated via Ansible
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.1-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -35,19 +35,6 @@ RUN set -x \
###
### Configure
###
RUN set -x \
&& { \
echo "[mail function]"; \
echo "sendmail_path = /usr/sbin/sendmail -t -i"; \
echo ";mail.force_extra_parameters ="; \
echo "mail.add_x_header = On"; \
echo "mail.log = /var/log/php/mail.log"; \
} > /usr/local/etc/php/conf.d/devilbox-mail.ini
###
### Verify
###

View File

@@ -1,4 +1,4 @@
# Auto-generated via Ansible
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.2-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -35,19 +35,6 @@ RUN set -x \
###
### Configure
###
RUN set -x \
&& { \
echo "[mail function]"; \
echo "sendmail_path = /usr/sbin/sendmail -t -i"; \
echo ";mail.force_extra_parameters ="; \
echo "mail.add_x_header = On"; \
echo "mail.log = /var/log/php/mail.log"; \
} > /usr/local/etc/php/conf.d/devilbox-mail.ini
###
### Verify
###

View File

@@ -14,9 +14,10 @@ set -o pipefail
###
set_timezone() {
local env_varname="${1}"
local php_conf_dir="${2}"
local php_ini_dir="${2}"
local debug="${3}"
local timezone=
local php_ini_file="${php_ini_dir}/devilbox-runtime-timezone.ini"
if ! env_set "${env_varname}"; then
log "info" "\$${env_varname} not set." "${debug}"
@@ -25,7 +26,7 @@ set_timezone() {
run "ln -sf /usr/share/zoneinfo/UTC /etc/localtime" "${debug}"
# PHP Time
log "info" "Setting PHP: timezone=UTC" "${debug}"
run "echo 'date.timezone = UTC' > ${php_conf_dir}/devilbox-runtime.ini" "${debug}"
run "echo 'date.timezone = UTC' > ${php_ini_file}" "${debug}"
else
timezone="$( env_get "${env_varname}" )"
if [ -f "/usr/share/zoneinfo/${timezone}" ]; then
@@ -34,7 +35,7 @@ set_timezone() {
run "ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime" "${debug}"
# PHP Time
log "info" "Setting PHP: timezone=${timezone}" "${debug}"
run "echo 'date.timezone = ${timezone}' > ${php_conf_dir}/devilbox-runtime.ini" "${debug}"
run "echo 'date.timezone = ${timezone}' > ${php_ini_file}" "${debug}"
else
log "err" "Invalid timezone for \$${env_varname}." "${debug}"
log "err" "Timezone '${timezone}' does not exist." "${debug}"

View File

@@ -16,18 +16,30 @@ set_postfix() {
local env_varname="${1}"
local username="${2}"
local groupname="${3}"
local debug="${4}"
local php_ini_dir="${4}"
local debug="${5}"
local php_ini_file="${php_ini_dir}/devilbox-runtime-sendmail.ini"
local catch_all=
if ! env_set "${env_varname}"; then
log "info" "\$${env_varname} not set." "${debug}"
log "info" "Postfix will not be started." "${debug}"
echo "" > "${php_ini_file}"
else
catch_all="$( env_get "${env_varname}" )"
if [ "${catch_all}" = "1" ]; then
log "info" "Enabling postfix catch-all" "${debug}"
# Configure PHP
{
echo "[mail function]";
echo "sendmail_path = $( which sendmail ) -t -i";
echo ";mail.force_extra_parameters =";
echo "mail.add_x_header = On";
echo "mail.log = /var/log/php/mail.log";
} > "${php_ini_file}"
# Add Mail dir/file if it does not exist
if [ ! -d "/var/mail" ]; then
run "mkdir /var/mail" "${debug}"
@@ -64,6 +76,10 @@ set_postfix() {
# Sanity Checks
############################################################
if ! command -v sendmail >/dev/null 2>&1; then
log "err" "sendmail not found, but required." "1"
exit 1
fi
if ! command -v postconf >/dev/null 2>&1; then
log "err" "postconf not found, but required." "1"
exit 1

View File

@@ -72,7 +72,7 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
###
### Setup postfix
###
set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${DEBUG_LEVEL}"
set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
###