PromucFlow_constructor/app/client/docker/start-nginx.sh
Arpit Mohan 9d2b017bf3
Making the nginx root configuration also configurable. (#694)
This is required for enabling custom logging. In future, we can leverage this for proxy caching as well.

Not adding this nginx-root.conf.template file to the installation script because there's nothing for the user to configure there during installation. This file will be baked into the Dockerfile and only the environment variables will be replaced during container start.
2020-10-16 10:00:33 +05:30

8 lines
538 B
Bash
Executable File

#!/bin/sh
# This script is baked into the appsmith-editor Dockerfile and is used to boot Nginx when the Docker container starts
# Refer: /app/client/Dockerfile
set -ue
cat /nginx.conf.template | envsubst "$(printf '$%s,' $(env | grep -Eo '^APPSMITH_[A-Z0-9_]+'))" | sed -e 's|\${\(APPSMITH_[A-Z0-9_]*\)}||g' > /etc/nginx/conf.d/default.conf
cat /nginx-root.conf.template | envsubst "$(printf '$%s,' $(env | grep -Eo '^APPSMITH_[A-Z0-9_]+'))" | sed -e 's|\${\(APPSMITH_[A-Z0-9_]*\)}||g' > /etc/nginx/nginx.conf
exec nginx -g 'daemon off;'