File size: 553 Bytes
a719852
 
 
24ac9bc
 
a719852
1ee79d8
 
 
 
 
 
 
 
a719852
24ac9bc
a719852
24ac9bc
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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