Files
ndsolutionswebsite/docker-entrypoint.sh
Daniel S 64c257f050
Some checks failed
Production Build & Deploy / build-and-deploy (push) Failing after 9s
feat(docker): add automatic container entrypoint seeding script
2026-08-09 22:05:48 +02:00

74 lines
1.8 KiB
Bash

#!/bin/sh
set -e
DATA_DIR=${DATA_DIR:-/app/data}
echo "🚀 [WaaS Container Entrypoint] Prüfe Daten-Volume unter ${DATA_DIR}..."
# 1. Sicherstellen, dass das Volume-Verzeichnis existiert
mkdir -p "$DATA_DIR"
# 2. site.config.json Seeding
if [ ! -f "$DATA_DIR/site.config.json" ]; then
echo "📄 Keine site.config.json gefunden. Erstelle Standard-Konfiguration..."
cat <<EOF > "$DATA_DIR/site.config.json"
{
"site_info": {
"title": "N&D IT Solutions Kunden-Website",
"company_name": "Mein Unternehmen",
"homepage_id": "page_home_01"
},
"navigation": [
{ "label": "Startseite", "page_id": "page_home_01" }
],
"pages": [
{
"id": "page_home_01",
"slug": "/",
"title": "Startseite",
"is_published": true,
"sections": [
{
"id": "sec_hero_init",
"type": "HeroSection",
"settings": {
"title": "Herzlich Willkommen",
"subtitle": "Ihre neue Website ist erfolgreich gestartet."
}
}
]
}
]
}
EOF
fi
# 3. theme.config.json Seeding
if [ ! -f "$DATA_DIR/theme.config.json" ]; then
echo "🎨 Keine theme.config.json gefunden. Erstelle Standard-Theme..."
cat <<EOF > "$DATA_DIR/theme.config.json"
{
"presetKey": "corporate-dark",
"mode": "dark"
}
EOF
fi
# 4. smtp.config.json Seeding
if [ ! -f "$DATA_DIR/smtp.config.json" ]; then
echo "✉️ Keine smtp.config.json gefunden. Erstelle Standard-SMTP Config..."
cat <<EOF > "$DATA_DIR/smtp.config.json"
{
"host": "localhost",
"port": 1025,
"from": "noreply@kunden-domain.de",
"recipient": "info@kunden-domain.de"
}
EOF
fi
echo "✅ All-in-One Initialisierung abgeschlossen. Starte Astro SSR Node Server..."
# Führe den eigentlichen Befehl aus (CMD aus Dockerfile)
exec "$@"