ToolJet/frontend/config/entrypoint.sh
Akshay 11df74b3a4
Docker deploy setup for Nestjs (#474)
* make nginx config generic

* fixes env substituted

* remove npm script dependencies from dev

* match all nginx location to server

* revert git clone dev branch
2021-08-09 10:02:25 +05:30

17 lines
574 B
Bash
Executable file

#!/usr/bin/env sh
set -eu
export SERVER_HOST="${SERVER_HOST:=server}"
export SERVER_USER="${SERVER_USER:=root}"
VARS_TO_SUBSTITUTE='$SERVER_HOST:$SERVER_USER'
envsubst "${VARS_TO_SUBSTITUTE}" < /etc/openresty/nginx.conf.template > /etc/openresty/nginx.conf
if [ ! -f /etc/fallback-certs/resty-auto-ssl-fallback.crt ]; then
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
-subj '/CN=sni-support-required-for-valid-ssl' \
-keyout /etc/fallback-certs/resty-auto-ssl-fallback.key \
-out /etc/fallback-certs/resty-auto-ssl-fallback.crt
fi
exec "$@"