kleinigkeiten für deploy prozess...

This commit is contained in:
br committed 2026-09-11 15:01:51 +02:00
1 parent c1c92d1169
commit 96c9ceafc1
6 files changed
+87 -57

No files matched your search

+2
View File
@@ -4,3 +4,5 @@ node_modules
tsout tsout
kbp_crm*.js kbp_crm*.js
App_Server/data/ App_Server/data/
.env
kbcrm
+2 -2
View File
@@ -52,8 +52,8 @@ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \
# --- 9. TypeScript + Rollup installieren --- # --- 9. TypeScript + Rollup installieren ---
# Das Script inittypescriptdev.sh wird in der Entwicklungsumgebung ausgeführt, um die TypeScript-Umgebung zu initialisieren. # Das Script inittypescriptdev.sh wird in der Entwicklungsumgebung ausgeführt, um die TypeScript-Umgebung zu initialisieren.
# Daher ist es nicht notwendig, es hier zu kopieren und auszuführen. # Daher ist es nicht notwendig, es hier zu kopieren und auszuführen.
# COPY ./scripts/inittypescriptdev.sh /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh #COPY ./scripts/inittypescriptdev.sh /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh
# RUN chmod +x /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh #RUN chmod +x /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh
ENTRYPOINT ["sh", "/usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh"] ENTRYPOINT ["sh", "/usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh"]
CMD ["/usr/opt/pythonapp/env/bin/python", "root/runserver.py", "-D"] CMD ["/usr/opt/pythonapp/env/bin/python", "root/runserver.py", "-D"]
+24 -4
View File
@@ -1,4 +1,24 @@
ARG NGINX_VERSION ARG NGINX_VERSION
FROM nginx:${NGINX_VERSION}
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime # --- Stage 1: Build the Client (TypeScript -> JS) ---
RUN mkdir /etc/certs FROM node:18-slim AS client-builder
WORKDIR /usr/opt/pythonapp
# Wir brauchen die Projekt-Dateien
COPY Client/ ./Client/
COPY App_Server/ ./App_Server/
COPY NGINX_Server/ ./NGINX_Server/
# Abhängigkeiten installieren und bauen
WORKDIR /usr/opt/pythonapp/Client
RUN npm install
RUN npx tsc && npx rollup -c
# --- Stage 2: NGINX Server (Final Image) ---
FROM nginx:${NGINX_VERSION}
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN mkdir /etc/certs
# Statischen HTML-Ordner inklusive des frischen JS aus Stage 1 kopieren
COPY --from=client-builder /usr/opt/pythonapp/NGINX_Server/html /usr/share/nginx/html
+28 -32
View File
@@ -1,32 +1,28 @@
name: kbpbase name: kbpbase
services: services:
nginx-proxy: nginx-proxy:
build: build:
context: NGINX_Server context: . # Build context im root, damit Client/ und NGINX_Server/ verfügbar sind
args: # Übergibt die ARGS an das dockerfile dockerfile: NGINX_Server/Dockerfile
NGINX_VERSION: ${NGINX_VERSION} args:
NGINX_VERSION: ${NGINX_VERSION}
ports: ports:
- ${NGINX_HOST_PORT}:4430 - ${NGINX_HOST_PORT}:4430
volumes: volumes:
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro - ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/templates
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/templates - ${NGINX_CERTS}:/etc/certs
- ${NGINX_CERTS}:/etc/certs env_file:
environment: - .env
- NGINX_CERT=${NGINX_CERT} pythonapp:
- NGINX_CERT_KEY=${NGINX_CERT_KEY} build:
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME} context: App_Server
pythonapp: args:
build: PYTHON_VERSION: ${PYTHON_VERSION}
context: App_Server env_file:
# target: kommt aus dem prod oder dev dockerfile - .env
args: # Übergibt die ARGS an das dockerfile volumes:
PYTHON_VERSION: ${PYTHON_VERSION} - ${PYTHON_DB_DIR}:/usr/var/pythonappdb
volumes: - python-venv:/usr/opt/pythonapp/env
#- ${PYTHON_APP_DIR}:/usr/opt/pythonapp/root
- ${PYTHON_DB_DIR}:/usr/var/pythonappdb volumes:
- python-venv:/usr/opt/pythonapp/env python-venv:
# - ${PYTHON_ENV_DIR}:/usr/opt/pythonapp/env
volumes:
python-venv:
+24 -19
View File
@@ -1,19 +1,24 @@
name: kbpdev name: kbpdev
services: services:
pythonapp: nginx-proxy:
extends: extends:
file: docker-compose.base.yaml file: docker-compose.base.yaml
service: pythonapp service: nginx-proxy
build: volumes:
target: dev - ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
args: # Übergibt die ARGS an das dockerfile
# PYTHON_VERSION: ${PYTHON_VERSION} pythonapp:
NODE_VERSION: ${NODE_VERSION:-18} extends:
NPM_VERSION: ${NPM_VERSION:-8} file: docker-compose.base.yaml
volumes: service: pythonapp
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp build:
# - ${TYPESCRIPT_SRC_DIR}:/usr/opt/typescript target: dev
- node-modules:/usr/opt/typescript/node_modules args:
NODE_VERSION: ${NODE_VERSION:-18}
volumes: NPM_VERSION: ${NPM_VERSION:-8}
node-modules: volumes:
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp
- node-modules:/usr/opt/typescript/node_modules
volumes:
node-modules:
Executable
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# legt variablen zur Laufzeit fest.
source ./.env
local env="${BUILD_ENVIRONMENT:-dev}"
echo "$env umbgebung wird gesetzt"
export COMPOSE_FILE="./docker-compose.base.yaml:./docker-compose.${env}.yaml"
echo "jetzt einfach docker compose [build | up | down | logs] ausführen"