Little helper to run CNCF's k3s in Docker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
k3d/proxy/nginx-proxy

24 lines
626 B

#!/bin/sh
set -e
# Config Options
INIT_CONFIG_MAX_RETRIES=3
# Run confd
for i in $(seq 1 $INIT_CONFIG_MAX_RETRIES); do
echo "[$(date -Iseconds)] creating initial nginx config (try $i/$INIT_CONFIG_MAX_RETRIES)"
confd -onetime -backend file -file /etc/confd/values.yaml -log-level debug -sync-only
sleep 2
done
# Output Configuration
echo "===== Initial nginx configuration ====="
nginx -T -c /etc/nginx/nginx.conf
echo "======================================="
# Start confd in watch mode (every second)
confd -watch -backend file -file /etc/confd/values.yaml -log-level debug &
# Start nginx
nginx -g 'daemon off;'