policyview_public / entrypoint.sh
cjerzak's picture
Update entrypoint.sh
1ee79d8 verified
raw
history blame contribute delete
553 Bytes
#!/usr/bin/env sh
set -eu
: "${UPSTREAM_HOST:?UPSTREAM_HOST is required, e.g., cjerzak-policyview.hf.space}"
: "${HF_TOKEN:?HF_TOKEN secret missing}"
# Writable temps for nginx
mkdir -p /tmp/nginx/client_temp \
/tmp/nginx/proxy_temp \
/tmp/nginx/fastcgi_temp \
/tmp/nginx/uwsgi_temp \
/tmp/nginx/scgi_temp
# Render config with secrets/vars
envsubst '${UPSTREAM_HOST} ${HF_TOKEN}' \
< /app/nginx.conf.template > /tmp/nginx.conf
# Run nginx using our config in /tmp
exec nginx -g 'daemon off;' -c /tmp/nginx.conf