slight hanges to the startup struktur with respkt to the more sufisticatet and gracefull start up sequenz
This commit is contained in:
@@ -41,19 +41,9 @@ services:
|
||||
MONGO_WAIT_QUEUE_TIMEOUT_MS: ${MONGO_WAIT_QUEUE_TIMEOUT_MS:-2000}
|
||||
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-0}
|
||||
JWT_SECRET_KEY: change-this-in-production
|
||||
INSTANCE_PROVISION_SCRIPT: /app/provision_instance.sh
|
||||
INSTANCE_BASE_DIR: /opt/inventarsystem-instances
|
||||
INSTANCE_PARENT_DOMAIN: ${INSTANCE_PARENT_DOMAIN:-meine-domain}
|
||||
INSTANCE_REPO_URL: ${INSTANCE_REPO_URL:-https://github.com/AIIrondev/legendary-octo-garbanzo}
|
||||
INSTANCE_TLS_MODE: ${INSTANCE_TLS_MODE:-development}
|
||||
INSTANCE_WILDCARD_CERT_FILE: ${INSTANCE_WILDCARD_CERT_FILE:-/etc/nginx/certs/wildcard.meine-domain.crt}
|
||||
INSTANCE_WILDCARD_KEY_FILE: ${INSTANCE_WILDCARD_KEY_FILE:-/etc/nginx/certs/wildcard.meine-domain.key}
|
||||
INSTANCE_BASE_DIR: /opt/Invario_Website
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /opt/inventarsystem-instances:/opt/inventarsystem-instances
|
||||
- /etc/nginx/sites-available:/etc/nginx/sites-available
|
||||
- /etc/nginx/sites-enabled:/etc/nginx/sites-enabled
|
||||
- /etc/nginx/certs:/etc/nginx/certs
|
||||
ports:
|
||||
- "4999:4999"
|
||||
mem_limit: 256m
|
||||
|
||||
+26
-4
@@ -4,6 +4,26 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
DOCKER_CMD=()
|
||||
|
||||
resolve_docker_cmd() {
|
||||
if docker info >/dev/null 2>&1; then
|
||||
DOCKER_CMD=(docker)
|
||||
return 0
|
||||
fi
|
||||
|
||||
if sudo -n docker info >/dev/null 2>&1; then
|
||||
DOCKER_CMD=(sudo docker)
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "[FEHLER] Kein Zugriff auf den Docker Daemon (/var/run/docker.sock)." >&2
|
||||
echo "Führe das Script mit sudo aus oder füge deinen User zur docker-Gruppe hinzu:" >&2
|
||||
echo " sudo usermod -aG docker $USER" >&2
|
||||
echo "Danach neu einloggen und Script erneut starten." >&2
|
||||
exit 3
|
||||
}
|
||||
|
||||
export SESSION_COOKIE_SECURE="0"
|
||||
export INSTANCE_TLS_MODE="development"
|
||||
export INSTANCE_PARENT_DOMAIN="${INSTANCE_PARENT_DOMAIN:-meine-domain}"
|
||||
@@ -21,8 +41,10 @@ if [ ! -f "$SCRIPT_DIR/gunicorn.conf.py" ]; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
docker compose build website
|
||||
docker compose up -d
|
||||
resolve_docker_cmd
|
||||
|
||||
"${DOCKER_CMD[@]}" compose build website
|
||||
"${DOCKER_CMD[@]}" compose up -d
|
||||
|
||||
# Wait for website to become healthy (simple HTTP check)
|
||||
check_url="http://localhost:4999"
|
||||
@@ -43,9 +65,9 @@ done
|
||||
if [ $elapsed -ge $timeout_seconds ]; then
|
||||
echo "[FEHLER] Website nicht erreichbar nach ${timeout_seconds}s. Sammle Diagnosedaten..."
|
||||
echo "--- docker compose ps ---"
|
||||
docker compose ps || true
|
||||
"${DOCKER_CMD[@]}" compose ps || true
|
||||
echo "--- docker logs website (tail 200) ---"
|
||||
docker logs --tail 200 website-website-1 || true
|
||||
"${DOCKER_CMD[@]}" logs --tail 200 website-website-1 || true
|
||||
echo "Bitte prüfe Container-Logs und nginx-Konfiguration."
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "Error: docker is not installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOCKER_CMD=(docker)
|
||||
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
if command -v sudo >/dev/null 2>&1 && sudo -n docker info >/dev/null 2>&1; then
|
||||
DOCKER_CMD=(sudo docker)
|
||||
echo "==> Docker daemon requires elevated permissions; using sudo docker"
|
||||
else
|
||||
echo "Error: cannot access Docker daemon (/var/run/docker.sock)."
|
||||
echo ""
|
||||
echo "Fix options:"
|
||||
echo " 1) Run once with sudo: sudo ./start_docker_build.sh"
|
||||
echo " 2) Permanent fix (recommended):"
|
||||
echo " sudo usermod -aG docker $USER"
|
||||
echo " newgrp docker"
|
||||
echo " # or logout/login"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! "${DOCKER_CMD[@]}" compose version >/dev/null 2>&1; then
|
||||
echo "Error: docker compose plugin is not available."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> Building website image (pure Python runtime)"
|
||||
"${DOCKER_CMD[@]}" compose build website
|
||||
|
||||
echo "==> Starting internal MongoDB + Website containers"
|
||||
"${DOCKER_CMD[@]}" compose up -d
|
||||
|
||||
echo "==> Container status"
|
||||
"${DOCKER_CMD[@]}" compose ps
|
||||
|
||||
echo "Application is starting on: http://localhost:4999"
|
||||
echo "Use: docker compose logs -f website"
|
||||
echo "Provisioning is available in the container via /app/provision_instance.sh"
|
||||
@@ -105,16 +105,16 @@
|
||||
<section class="module-shell" aria-label="Module Übersicht">
|
||||
<div class="module-nav" role="navigation" aria-label="Module Navigation">
|
||||
<ul>
|
||||
<li class="active" data-module="mod1"><a href="#mod1">Modul 1</a></li>
|
||||
<li data-module="mod2"><a href="#mod2">Modul 2</a></li>
|
||||
<li data-module="mod3"><a href="#mod3">Modul 3</a></li>
|
||||
<li data-module="mod4"><a href="#mod4">Modul 4</a></li>
|
||||
<li class="active" data-module="mod1"><a href="#mod1">Inventarsystem</a></li>
|
||||
<li data-module="mod2"><a href="#mod2">Bibliothekssystem</a></li>
|
||||
<li data-module="mod3"><a href="#mod3">Terminplaner</a></li>
|
||||
<li data-module="mod4"><a href="#mod4">Mail Add On</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="module-content" id="moduleContent">
|
||||
<article id="mod1" class="module-panel">
|
||||
<h2>Modul 1 — Titel</h2>
|
||||
<h2>Inventarsystem</h2>
|
||||
<p class="lede">Kurze Zusammenfassung des Moduls. (Platzhalter — du ersetzt den Inhalt später.)</p>
|
||||
<h3>Was ist das?</h3>
|
||||
<p>Beschreibe hier den Zweck, Zielgruppe und schnelle Anwendungsfälle.</p>
|
||||
@@ -132,17 +132,17 @@
|
||||
</article>
|
||||
|
||||
<article id="mod2" class="module-panel hidden">
|
||||
<h2>Modul 2 — Titel</h2>
|
||||
<h2>Bibliothekssystem</h2>
|
||||
<p class="lede">Platzhaltertext für Modul 2.</p>
|
||||
</article>
|
||||
|
||||
<article id="mod3" class="module-panel hidden">
|
||||
<h2>Modul 3 — Titel</h2>
|
||||
<h2>Terminplaner</h2>
|
||||
<p class="lede">Platzhaltertext für Modul 3.</p>
|
||||
</article>
|
||||
|
||||
<article id="mod4" class="module-panel hidden">
|
||||
<h2>Modul 4 — Titel</h2>
|
||||
<h2>Mail Add On</h2>
|
||||
<p class="lede">Platzhaltertext für Modul 4.</p>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user