Implement automatic Nginx updates and hosts synchronization for development and production environments

This commit is contained in:
2026-04-16 14:39:46 +02:00
parent afc7fe3423
commit 09cb8306ff
10 changed files with 287 additions and 4 deletions
+6
View File
@@ -18,6 +18,12 @@ echo " DEV_HOSTS_REFRESH_INTERVAL=$DEV_HOSTS_REFRESH_INTERVAL"
docker compose build website
docker compose up -d
NGINX_SCRIPT="$SCRIPT_DIR/../nginx.sh"
if [[ -x "$NGINX_SCRIPT" ]]; then
echo "Aktualisiere Nginx Reverse Proxy..."
sudo "$NGINX_SCRIPT" apply || echo "Warnung: Nginx konnte nicht automatisch aktualisiert werden."
fi
if [[ -x "$SCRIPT_DIR/sync_dev_hosts.sh" ]]; then
"$SCRIPT_DIR/sync_dev_hosts.sh" || true
if [[ "${DEV_HOSTS_REFRESH_INTERVAL}" != "0" ]]; then
+22
View File
@@ -27,5 +27,27 @@ echo " INSTANCE_WILDCARD_KEY_FILE=$INSTANCE_WILDCARD_KEY_FILE"
docker compose build website
docker compose up -d
NGINX_SCRIPT="$SCRIPT_DIR/../nginx.sh"
if [[ -x "$NGINX_SCRIPT" ]]; then
echo "Aktualisiere Nginx Reverse Proxy..."
sudo "$NGINX_SCRIPT" apply || echo "Warnung: Nginx konnte nicht automatisch aktualisiert werden."
fi
# Automatically sync hosts after container start
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -x "$SCRIPT_DIR/sync_dev_hosts.sh" ]]; then
echo "Warte auf MongoDB-Verfügbarkeit..."
sleep 5
"$SCRIPT_DIR/sync_dev_hosts.sh" || true
echo "Production Hosts werden synchronisiert (stündlich)"
# Starte Background-Daemon für stündliche Sync
if [[ "${PROD_HOSTS_REFRESH_INTERVAL}" != "0" ]]; then
nohup bash -lc "while true; do '$SCRIPT_DIR/sync_dev_hosts.sh' >/dev/null 2>&1 || true; sleep ${PROD_HOSTS_REFRESH_INTERVAL:-3600}; done" \
>"$SCRIPT_DIR/prod-hosts-sync.log" 2>&1 &
echo " Prod-Hosts-Sync läuft im Hintergrund (Log: $SCRIPT_DIR/prod-hosts-sync.log)"
fi
fi
echo "Production stack is running on http://localhost:4999"
echo "Provisioning expects wildcard certificate for all subdomains."
+2 -2
View File
@@ -40,8 +40,8 @@
<h2>4. Kontaktinformationen</h2>
<p>
<strong>Telefon:</strong> +49 (0) 123 / 456789<br>
<strong>E-Mail:</strong> info@invario.cloud<br>
<strong>Website:</strong> www.invario.cloud
<strong>E-Mail:</strong> info@invario.eu<br>
<strong>Website:</strong> www.invario.eu
</p>
</section>