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
+47 -17

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"]
+20
View File
@@ -1,4 +1,24 @@
ARG NGINX_VERSION ARG NGINX_VERSION
# --- Stage 1: Build the Client (TypeScript -> JS) ---
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} FROM nginx:${NGINX_VERSION}
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN mkdir /etc/certs 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
+8 -12
View File
@@ -2,31 +2,27 @@ 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
args:
NGINX_VERSION: ${NGINX_VERSION} 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
environment: env_file:
- NGINX_CERT=${NGINX_CERT} - .env
- NGINX_CERT_KEY=${NGINX_CERT_KEY}
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME}
pythonapp: pythonapp:
build: build:
context: App_Server context: App_Server
# target: kommt aus dem prod oder dev dockerfile args:
args: # Übergibt die ARGS an das dockerfile
PYTHON_VERSION: ${PYTHON_VERSION} PYTHON_VERSION: ${PYTHON_VERSION}
env_file:
- .env
volumes: volumes:
#- ${PYTHON_APP_DIR}:/usr/opt/pythonapp/root
- ${PYTHON_DB_DIR}:/usr/var/pythonappdb - ${PYTHON_DB_DIR}:/usr/var/pythonappdb
- python-venv:/usr/opt/pythonapp/env - python-venv:/usr/opt/pythonapp/env
# - ${PYTHON_ENV_DIR}:/usr/opt/pythonapp/env
volumes: volumes:
python-venv: python-venv:
+8 -3
View File
@@ -1,18 +1,23 @@
name: kbpdev name: kbpdev
services: services:
nginx-proxy:
extends:
file: docker-compose.base.yaml
service: nginx-proxy
volumes:
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
pythonapp: pythonapp:
extends: extends:
file: docker-compose.base.yaml file: docker-compose.base.yaml
service: pythonapp service: pythonapp
build: build:
target: dev target: dev
args: # Übergibt die ARGS an das dockerfile args:
# PYTHON_VERSION: ${PYTHON_VERSION}
NODE_VERSION: ${NODE_VERSION:-18} NODE_VERSION: ${NODE_VERSION:-18}
NPM_VERSION: ${NPM_VERSION:-8} NPM_VERSION: ${NPM_VERSION:-8}
volumes: volumes:
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp - ${PYTHON_DEV_DIR}:/usr/opt/pythonapp
# - ${TYPESCRIPT_SRC_DIR}:/usr/opt/typescript
- node-modules:/usr/opt/typescript/node_modules - node-modules:/usr/opt/typescript/node_modules
volumes: volumes:
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"