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
kbp_crm*.js
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 ---
# 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.
# COPY ./scripts/inittypescriptdev.sh /usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh
# RUN chmod +x /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
ENTRYPOINT ["sh", "/usr/opt/pythonapp/App_Server/scripts/inittypescriptdev.sh"]
CMD ["/usr/opt/pythonapp/env/bin/python", "root/runserver.py", "-D"]
+24 -4
View File
@@ -1,4 +1,24 @@
ARG NGINX_VERSION
FROM nginx:${NGINX_VERSION}
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN mkdir /etc/certs
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}
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
services:
nginx-proxy:
build:
context: NGINX_Server
args: # Übergibt die ARGS an das dockerfile
NGINX_VERSION: ${NGINX_VERSION}
ports:
- ${NGINX_HOST_PORT}:4430
volumes:
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/templates
- ${NGINX_CERTS}:/etc/certs
environment:
- NGINX_CERT=${NGINX_CERT}
- NGINX_CERT_KEY=${NGINX_CERT_KEY}
- 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
PYTHON_VERSION: ${PYTHON_VERSION}
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:
name: kbpbase
services:
nginx-proxy:
build:
context: . # Build context im root, damit Client/ und NGINX_Server/ verfügbar sind
dockerfile: NGINX_Server/Dockerfile
args:
NGINX_VERSION: ${NGINX_VERSION}
ports:
- ${NGINX_HOST_PORT}:4430
volumes:
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/templates
- ${NGINX_CERTS}:/etc/certs
env_file:
- .env
pythonapp:
build:
context: App_Server
args:
PYTHON_VERSION: ${PYTHON_VERSION}
env_file:
- .env
volumes:
- ${PYTHON_DB_DIR}:/usr/var/pythonappdb
- python-venv:/usr/opt/pythonapp/env
volumes:
python-venv:
+24 -19
View File
@@ -1,19 +1,24 @@
name: kbpdev
services:
pythonapp:
extends:
file: docker-compose.base.yaml
service: pythonapp
build:
target: dev
args: # Übergibt die ARGS an das dockerfile
# PYTHON_VERSION: ${PYTHON_VERSION}
NODE_VERSION: ${NODE_VERSION:-18}
NPM_VERSION: ${NPM_VERSION:-8}
volumes:
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp
# - ${TYPESCRIPT_SRC_DIR}:/usr/opt/typescript
- node-modules:/usr/opt/typescript/node_modules
volumes:
node-modules:
name: kbpdev
services:
nginx-proxy:
extends:
file: docker-compose.base.yaml
service: nginx-proxy
volumes:
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
pythonapp:
extends:
file: docker-compose.base.yaml
service: pythonapp
build:
target: dev
args:
NODE_VERSION: ${NODE_VERSION:-18}
NPM_VERSION: ${NPM_VERSION:-8}
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"