dvirlabs-landing/docker-entrypoint.sh
2025-11-26 03:41:47 +02:00

21 lines
473 B
Bash

#!/bin/sh
set -e
TEMPLATE=/usr/share/nginx/html/index.html.template
TARGET=/usr/share/nginx/html/index.html
# שומרים טמפלייט פעם אחת
if [ ! -f "$TEMPLATE" ]; then
cp "$TARGET" "$TEMPLATE"
fi
cp "$TEMPLATE" "$TARGET"
# מחליף את placeholder של הלינקים ב-JSON מה-ENV
if [ -n "$LAB_LINKS" ]; then
# משתמש ב-| כדי לא להסתבך עם / ב-URL
sed -i "s|__LAB_LINKS__|$LAB_LINKS|g" "$TARGET"
fi
nginx -g 'daemon off;'