feat(deploy): Multi-Stage-Docker-Build fuer automatisches Deployment

- App_Server/Dockerfile: Build-Context auf Repo-Root, COPY-Pfade
  angepasst, ENTRYPOINT aktiviert, dev-Stage mit inittypescriptdev.sh
- NGINX_Server/Dockerfile: Multi-Stage mit frontend-Stage (Node.js baut
  TypeScript), statische Dateien und Config-Templates ins Image kopiert
- docker-compose.base.yaml: Context auf '.', python-venv Volume entfernt,
  NGINX_STATIC_DIR/CONFIG_TEMPLATE_DIR bind-mounts in Dev verschoben
- docker-compose.dev.yaml: python-venv-dev Volume, APP_DEBUG=true,
  nginx-proxy mit bind-mounts fuer statische Dateien und Templates
- docker-compose.prod.yaml: Code-bind-mount entfernt, nginx-proxy extends
- approot.py: absolute Pfade, Debug-Modus via APP_DEBUG Umgebungsvariable
- init.sh: vereinfacht (kein cd/pip, absolute Pfade)
- inireader.mjs: absoluter Pfad fuer config.ini
- package.json: scripts.build (tsc + rollup) ergaenzt
- .dockerignore, deploy-kbcrm-test.sh, deploy-kbcrm-prod.sh erstellt
- docker-compose.save.yaml geloescht
- env-sample: BUILD_ENVIRONMENT nach oben, Dev-only Variablen markiert

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
gg committed 2026-09-13 18:40:55 +02:00
1 parent 31ef206bd8
commit 3b3e2893e5
14 files changed
+200 -91

No files matched your search

+15 -9
View File
@@ -1,3 +1,12 @@
# =============================================================================
# BUILD-UMGEBUNG (zentrale Einstellung — hier dev/prod umschalten)
# =============================================================================
# Bestimmt, welche docker-compose-*.yaml neben der base-Datei geladen wird.
# COMPOSE_FILE wird von Docker Compose automatisch ausgewertet (auch via .env);
# mehrere Dateien werden durch ':' getrennt und nacheinander gemerged.
BUILD_ENVIRONMENT=dev
COMPOSE_FILE=docker-compose.base.yaml:docker-compose.${BUILD_ENVIRONMENT}.yaml
# Parameter für NGINX-Server
NGINX_VERSION=mainline-alpine
# SSL für NGINX aktivieren (true) oder deaktivieren (false).
@@ -5,7 +14,11 @@ NGINX_VERSION=mainline-alpine
NGINX_USE_SSL=true
NGINX_HOST_PORT=443
NGINX_SERVER_NAME=kbp_crm.mylocal.de
# NGINX_STATIC_DIR: nur in Dev benoetigt (bind-mount fuer statische Dateien).
# In Prod liegen die statischen Dateien im NGINX-Image.
NGINX_STATIC_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/NGINX_Server/html
# NGINX_CONFIG_TEMPLATE_DIR: nur in Dev benoetigt (bind-mount fuer NGINX-Templates).
# In Prod liegen die Templates im NGINX-Image.
NGINX_CONFIG_TEMPLATE_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/NGINX_Server/configtemplates
NGINX_CERTS=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/NGINX_Server/certs
NGINX_CERT=wildcard.mylocal.crt
@@ -13,7 +26,8 @@ NGINX_CERT_KEY=wildcard.mylocal.key
# Parameter for Python App-Server
PYTHON_VERSION=slim-bookworm
PYTHON_APP_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/App_Server/root
# PYTHON_APP_DIR entfaellt — Code wird in Prod ins Image gebaut (Option B).
# In Dev wird PYTHON_DEV_DIR als bind-mount verwendet (siehe docker-compose.dev.yaml).
PYTHON_DEV_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm
PYTHON_DB_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/App_Server/data
# PYTHON_ENV_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/App_Server/env
@@ -22,14 +36,6 @@ PYTHON_DB_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/App_Server/data
NODE_VERSION=lts
NPM_VERSION=latest
# Umgebung für Docker-Compose-Stack (prod oder dev).
# Bestimmt, welche docker-compose-*.yaml neben der base-Datei geladen wird.
# COMPOSE_FILE wird von Docker Compose automatisch ausgewertet (auch via .env);
# mehrere Dateien werden durch ':' getrennt und nacheinander gemerged.
# Dadurch entfällt der mehrfache Aufruf des -f Parameters beim docker compose Aufruf.
BUILD_ENVIRONMENT=dev
COMPOSE_FILE=docker-compose.base.yaml:docker-compose.${BUILD_ENVIRONMENT}.yaml
# =============================================================================
# ZITADEL OIDC SETTINGS
# =============================================================================