From 65b84170120f8cd24cb85d1649f4293aa9d35eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Tue, 6 Feb 2018 19:27:18 +0100 Subject: [PATCH] add comments --- .s2i/bin/run | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.s2i/bin/run b/.s2i/bin/run index b13bc09..4d1b489 100755 --- a/.s2i/bin/run +++ b/.s2i/bin/run @@ -1,15 +1,19 @@ #!/bin/bash +# In dev environments this file is missing and useless test -f /opt/app-root/etc/generate_container_user && source /opt/app-root/etc/generate_container_user +# Stop as soon as an error occurs set -e # Default values are set here export "LOG_LEVEL=${LOG_LEVEL:=info}" export "NGINX_CONF=${NGINX_CONF:=/opt/app-root/etc/}" +# Process the environment variables in the nginx configuration file if [ -f "$NGINX_CONF/nginx.env.conf" ]; then envsubst '$LOG_LEVEL:$RESOLVER:$APP_ROOT:$SSO_SERVICE_HOSTNAME:$PROXY_ROUTE_HOSTNAME' < "$NGINX_CONF/nginx.env.conf" > "$NGINX_CONF/nginx.conf" fi +# Run nginx with our custom config file exec nginx -g "daemon off;" -c "$NGINX_CONF/nginx.conf"