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:
1 parent
31ef206bd8
commit
3b3e2893e5
14 files changed
+200
-91
No files matched your search
+16
-14
@@ -2,15 +2,19 @@ name: kbpbase
|
||||
services:
|
||||
nginx-proxy:
|
||||
build:
|
||||
context: NGINX_Server
|
||||
args: # Übergibt die ARGS an das dockerfile
|
||||
NGINX_VERSION: ${NGINX_VERSION}
|
||||
context: . # Repo-Root (fuer frontend-Stage im NGINX-Dockerfile)
|
||||
dockerfile: NGINX_Server/Dockerfile # explizit, da Context nicht mehr NGINX_Server/
|
||||
args:
|
||||
NGINX_VERSION: ${NGINX_VERSION}
|
||||
NODE_VERSION: ${NODE_VERSION}
|
||||
NPM_VERSION: ${NPM_VERSION}
|
||||
|
||||
ports:
|
||||
- ${NGINX_HOST_PORT}:4430
|
||||
volumes:
|
||||
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
|
||||
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/configtemplates:ro
|
||||
# NGINX_STATIC_DIR entfaellt in Prod — statische Dateien sind im NGINX-Image
|
||||
# NGINX_CONFIG_TEMPLATE_DIR entfaellt in Prod — Templates sind im Image
|
||||
# Beide werden in Dev per bind-mount ueberschrieben (siehe docker-compose.dev.yaml)
|
||||
- ${NGINX_CERTS}:/etc/certs
|
||||
environment:
|
||||
- NGINX_USE_SSL=${NGINX_USE_SSL:-true}
|
||||
@@ -19,15 +23,13 @@ services:
|
||||
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME}
|
||||
pythonapp:
|
||||
build:
|
||||
context: App_Server
|
||||
# target: kommt aus dem prod oder dev dockerfile
|
||||
args: # Übergibt die ARGS an das dockerfile
|
||||
context: . # Repo-Root (fuer COPY-Pfade im Dockerfile)
|
||||
dockerfile: App_Server/Dockerfile # explizit, da Context nicht mehr App_Server/
|
||||
args:
|
||||
PYTHON_VERSION: ${PYTHON_VERSION}
|
||||
NODE_VERSION: ${NODE_VERSION} # fuer dev-Stage
|
||||
NPM_VERSION: ${NPM_VERSION} # fuer dev-Stage
|
||||
volumes:
|
||||
#- ${PYTHON_APP_DIR}:/usr/opt/pythonapp/root
|
||||
- ${PYTHON_DB_DIR}:/usr/var/pythonappdb
|
||||
- python-venv:/usr/opt/pythonapp/env
|
||||
# - ${PYTHON_ENV_DIR}:/usr/opt/pythonapp/env
|
||||
|
||||
volumes:
|
||||
python-venv:
|
||||
# python-venv Volume entfaellt — venv ist im Image
|
||||
# (dev-Stage definiert eigenen Volume in docker-compose.dev.yaml)
|
||||
Reference in new issue
Block a user