docker-entrypoint.sh 826 B

12345678910111213141516171819
  1. #!/bin/bash
  2. if [ "${NGINX_HTTPS_ENABLED}" = "true" ]; then
  3. # set the HTTPS_CONFIG environment variable to the content of the https.conf.template
  4. HTTPS_CONFIG=$(envsubst < /etc/nginx/https.conf.template)
  5. export HTTPS_CONFIG
  6. # Substitute the HTTPS_CONFIG in the default.conf.template with content from https.conf.template
  7. envsubst '${HTTPS_CONFIG}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
  8. fi
  9. env_vars=$(printenv | cut -d= -f1 | sed 's/^/$/g' | paste -sd, -)
  10. envsubst "$env_vars" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
  11. envsubst "$env_vars" < /etc/nginx/proxy.conf.template > /etc/nginx/proxy.conf
  12. envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
  13. # Start Nginx using the default entrypoint
  14. exec nginx -g 'daemon off;'