snikket-web-proxy/entrypoint.sh

20 lines
786 B
Bash
Raw Normal View History

2020-11-05 15:35:56 +00:00
#!/bin/bash
CERT_PATH="/snikket/letsencrypt/live/$SNIKKET_DOMAIN/cert.pem"
export SNIKKET_TWEAK_HTTP_PORT=${SNIKKET_TWEAK_HTTP_PORT-80}
2020-12-13 07:25:17 +00:00
export SNIKKET_TWEAK_HTTPS_PORT=${SNIKKET_TWEAK_HTTPS_PORT-443}
export SNIKKET_TWEAK_INTERNAL_HTTP_PORT=${SNIKKET_TWEAK_INTERNAL_HTTP_PORT-5280}
2021-01-29 14:04:29 +00:00
export SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT=${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT-5765}
2020-11-05 15:35:56 +00:00
if test -f "$CERT_PATH"; then
## Certs already exist - render and deploy configs
for proto in http https; do
2021-01-22 13:02:39 +00:00
envsubst '$SNIKKET_DOMAIN $SNIKKET_TWEAK_HTTP_PORT $SNIKKET_TWEAK_HTTPS_PORT $SNIKKET_TWEAK_INTERNAL_HTTP_PORT $SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT' \
< /etc/nginx/templates/$proto \
> /etc/nginx/sites-enabled/$proto;
2020-11-05 15:35:56 +00:00
done
fi
exec supervisord -c /etc/supervisord/supervisord.conf