12 lines
440 B
Bash
12 lines
440 B
Bash
#!/bin/sh
|
|
# Render config templates with environment variables, then start nginx.
|
|
set -e
|
|
|
|
# Ensure nginx can write to the shared logs directory
|
|
mkdir -p /logs && chown nginx:nginx /logs
|
|
|
|
sed "s|__API_UPSTREAM__|${API_UPSTREAM}|g" /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf
|
|
envsubst '${API_PUBLIC_URL}' < /usr/share/nginx/html/config.json.template > /usr/share/nginx/html/config.json
|
|
|
|
exec nginx -g 'daemon off;'
|