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
5 files changed
+45 -15

No files matched your search

+2
View File
@@ -4,3 +4,5 @@ node_modules
tsout
kbp_crm*.js
App_Server/data/
.env
kbcrm
+20
View File
@@ -1,4 +1,24 @@
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
+8 -12
View File
@@ -2,31 +2,27 @@ name: kbpbase
services:
nginx-proxy:
build:
context: NGINX_Server
args: # Übergibt die ARGS an das dockerfile
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_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}
env_file:
- .env
pythonapp:
build:
context: App_Server
# target: kommt aus dem prod oder dev dockerfile
args: # Übergibt die ARGS an das dockerfile
args:
PYTHON_VERSION: ${PYTHON_VERSION}
env_file:
- .env
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:
+8 -3
View File
@@ -1,18 +1,23 @@
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: # Übergibt die ARGS an das dockerfile
# PYTHON_VERSION: ${PYTHON_VERSION}
args:
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:
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"