- Create Dockerfile for Nginx with envsubst for dynamic configuration. - Add djmaster.conf.template for Nginx configuration with upstream services. - Implement docker-entrypoint.sh to substitute environment variables in the Nginx config. - Add README.md in nginx-examples for guidance on using the Nginx template. - Include djmaster.conf.template in nginx-examples for local setup. - Introduce utility functions for fetching YouTube video snippets and titles.
15 lines
508 B
Bash
15 lines
508 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# Provide defaults
|
|
: ${YTDLP_HOST:=192.168.1.20:8282}
|
|
: ${YTDLP_TITLES_HOST:=100.73.244.28:8080}
|
|
: ${LIVEKIT_INGRESS_HOST:=192.168.1.20:8088}
|
|
: ${EGRESS_HOST:=llmchats-whep.zuqtxy.easypanel.host}
|
|
: ${UI_HOST:=djmaster.nextream.sytes.net}
|
|
|
|
# Replace template variables and write final nginx conf
|
|
envsubst '$YTDLP_HOST $YTDLP_TITLES_HOST $LIVEKIT_INGRESS_HOST $EGRESS_HOST $UI_HOST' < /etc/nginx/templates/djmaster.conf.template > /etc/nginx/conf.d/djmaster.conf
|
|
|
|
exec nginx -g 'daemon off;'
|