#!/bin/sh echo "" echo "***********************************************************" echo " Starting NGINX PHP-FPM Docker Container " echo "***********************************************************" set -e set -e info() { { set +x; } 2> /dev/null echo '[INFO] ' "$@" } warning() { { set +x; } 2> /dev/null echo '[WARNING] ' "$@" } fatal() { { set +x; } 2> /dev/null echo '[ERROR] ' "$@" >&2 exit 1 } # Enable custom nginx config files if they exist if [ -f /var/www/html/conf/nginx/nginx.conf ]; then cp /var/www/html/conf/nginx/nginx.conf /etc/nginx/nginx.conf info "Using custom nginx.conf" fi if [ -f /var/www/html/conf/nginx/nginx-site.conf ]; then info "Custom nginx site config found" rm /etc/nginx/conf.d/default.conf cp /var/www/html/conf/nginx/nginx-site.conf /etc/nginx/conf.d/default.conf info "Start nginx with custom server config..." else info "nginx-site.conf not found" info "If you want to use custom configs, create config file in /var/www/html/conf/nginx/nginx-site.conf" info "Start nginx with default config..." rm -f /etc/nginx/conf.d/default.conf TASK=/etc/nginx/conf.d/default.conf touch $TASK cat > "$TASK" <