Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1795e2f41 | ||
|
|
9ee0433c4d | ||
|
|
55d03ddeb3 | ||
|
|
b6268f7d22 | ||
|
|
ef563bad2f | ||
|
|
a6876fcc55 |
No files matched your search
@@ -17,7 +17,8 @@
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode"
|
||||
"esbenp.prettier-vscode",
|
||||
"mistralai.mistral-vibe-code"
|
||||
],
|
||||
"settings": {
|
||||
"python.defaultInterpreterPath": "/usr/opt/pythonapp/env/bin/python",
|
||||
|
||||
+7
-5
@@ -1,8 +1,10 @@
|
||||
__pycache__
|
||||
env
|
||||
node_modules
|
||||
tsout
|
||||
.env
|
||||
env/
|
||||
node_modules/
|
||||
tsout/
|
||||
kbp_crm*.js
|
||||
App_Server/data/
|
||||
.env
|
||||
kbcrm
|
||||
oidc-test/
|
||||
.vibe/
|
||||
.vibe-global/
|
||||
@@ -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"]
|
||||
|
||||
+16
-3
@@ -69,7 +69,7 @@ function logout() {
|
||||
if (result['logout'] == true) {m.route.set("/blankpage")}
|
||||
})
|
||||
.finally(() => {
|
||||
location.href = "/index.html"
|
||||
setTimeout(() => { location.href = "/index.html" }, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -86,6 +86,19 @@ const hello: m.Component = {
|
||||
}
|
||||
}
|
||||
|
||||
const loggedout: m.Component = {
|
||||
view: () => {
|
||||
return m("h1", {
|
||||
style: {
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
height: "100%"
|
||||
}
|
||||
}, "Sie sind nicht mehr angemeldet!")
|
||||
}
|
||||
}
|
||||
|
||||
const hello2: m.Component = {
|
||||
view: (vnode) => {
|
||||
return m("ul",
|
||||
@@ -174,8 +187,8 @@ if (check_currentuser() == false) {
|
||||
m.route.set("/login")
|
||||
}
|
||||
|
||||
m.route(gridMountpoints.main, "/blankpage", {
|
||||
"/blankpage": hello,
|
||||
m.route(gridMountpoints.main, "/kundenliste", {
|
||||
"/blankpage": loggedout,
|
||||
"/usermanagement": appmanagementpage,
|
||||
"/changepassword": changepasswordscreen,
|
||||
"/login": loginscreen,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
# Wählt das NGINX-Template abhängig von NGINX_USE_SSL aus.
|
||||
# Kopiert das passende Template aus dem Staging-Mount (read-only) in das
|
||||
# container-interne Verzeichnis, das vom envsubst-Skript verarbeitet wird.
|
||||
# Läuft als 10-… vor dem eingebauten 20-envsubst-on-templates.sh.
|
||||
|
||||
src_dir="/etc/nginx/configtemplates"
|
||||
dst_dir="/etc/nginx/templates"
|
||||
|
||||
# Falls noch ein Template aus einem vorherigen Start im dst_dir liegt, entfernen.
|
||||
rm -f "$dst_dir"/kbp_crm.*.conf.template
|
||||
|
||||
if [ "$NGINX_USE_SSL" = "false" ]; then
|
||||
cp "$src_dir/kbp_crm.nossl.conf.template" "$dst_dir/"
|
||||
else
|
||||
cp "$src_dir/kbp_crm.ssl.conf.template" "$dst_dir/"
|
||||
fi
|
||||
+6
-24
@@ -1,24 +1,6 @@
|
||||
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
|
||||
ARG NGINX_VERSION
|
||||
FROM nginx:${NGINX_VERSION}
|
||||
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
|
||||
RUN mkdir -p /etc/certs /etc/nginx/templates
|
||||
COPY 10-select-ssl.sh /docker-entrypoint.d/10-select-ssl.sh
|
||||
RUN chmod +x /docker-entrypoint.d/10-select-ssl.sh
|
||||
@@ -0,0 +1,35 @@
|
||||
# Zunächst wird ein Default-Server definiert.
|
||||
# Das Standardverhalten von NGINX ist nämlich wie folgt:
|
||||
# Wenn im Request ein Server-Name reinkommt und NGINX keinen Server-Block findet, in dem dieser
|
||||
# Servername definiert wird, wird einfach der erste definierte Serverblock genommen.
|
||||
# Dadurch, dass ein expliziter Default-Server definiert wird, wird dieser verwendet.
|
||||
# Falls jetzt also ein Servername übergeben wird, den es nicht gibt, gibt NGINX den Error-Code 404 zurück
|
||||
server {
|
||||
listen 4430 default_server;
|
||||
return 404;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 4430;
|
||||
server_name ${NGINX_SERVER_NAME};
|
||||
resolver 127.0.0.11 valid=30s; # notwendig, damit der Upstream (s.u.) nicht direkt den nginx-Server stoppt, falls pythonapp noch nicht soweit ist
|
||||
# https://sandro-keil.de/blog/let-nginx-start-if-upstream-host-is-unavailable-or-down/
|
||||
|
||||
location /static {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
location / {
|
||||
# Variable muss benutzt werden (s.o. bei resolver Direktive)
|
||||
set $upstream pythonapp:8080;
|
||||
proxy_pass http://$upstream;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /health-check {
|
||||
add_header Content-Type text/plain;
|
||||
return 200 "success $time_iso8601";
|
||||
}
|
||||
}
|
||||
+38
-38
@@ -1,38 +1,38 @@
|
||||
ssl_certificate /etc/certs/${NGINX_CERT};
|
||||
ssl_certificate_key /etc/certs/${NGINX_CERT_KEY};
|
||||
|
||||
# Zunächst wird ein Default-Server definiert.
|
||||
# Das Standardverhalten von NGINX ist nämlich wie folgt:
|
||||
# Wenn im Request ein Server-Name reinkommt und NGINX keinen Server-Block findet, in dem dieser
|
||||
# Servername definiert wird, wird einfach der erste definierte Serverblock genommen.
|
||||
# Dadurch, dass ein expliziter Default-Server definiert wird, wird dieser verwendet.
|
||||
# Falls jetzt also ein Servername übergeben wird, den es nicht gibt, gibt NGINX den Error-Code 404 zurück
|
||||
server {
|
||||
listen 4430 ssl default_server;
|
||||
return 404;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 4430 ssl;
|
||||
server_name ${NGINX_SERVER_NAME};
|
||||
resolver 127.0.0.11 valid=30s; # notwendig, damit der Upstream (s.u.) nicht direkt den nginx-Server stoppt, falls pythonapp noch nicht soweit ist
|
||||
# https://sandro-keil.de/blog/let-nginx-start-if-upstream-host-is-unavailable-or-down/
|
||||
|
||||
location /static {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
location / {
|
||||
# Variable muss benutzt werden (s.o. bei resolver Direktive)
|
||||
set $upstream pythonapp:8080;
|
||||
proxy_pass http://$upstream;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /health-check {
|
||||
add_header Content-Type text/plain;
|
||||
return 200 "success $time_iso8601";
|
||||
}
|
||||
}
|
||||
ssl_certificate /etc/certs/${NGINX_CERT};
|
||||
ssl_certificate_key /etc/certs/${NGINX_CERT_KEY};
|
||||
|
||||
# Zunächst wird ein Default-Server definiert.
|
||||
# Das Standardverhalten von NGINX ist nämlich wie folgt:
|
||||
# Wenn im Request ein Server-Name reinkommt und NGINX keinen Server-Block findet, in dem dieser
|
||||
# Servername definiert wird, wird einfach der erste definierte Serverblock genommen.
|
||||
# Dadurch, dass ein expliziter Default-Server definiert wird, wird dieser verwendet.
|
||||
# Falls jetzt also ein Servername übergeben wird, den es nicht gibt, gibt NGINX den Error-Code 404 zurück
|
||||
server {
|
||||
listen 4430 ssl default_server;
|
||||
return 404;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 4430 ssl;
|
||||
server_name ${NGINX_SERVER_NAME};
|
||||
resolver 127.0.0.11 valid=30s; # notwendig, damit der Upstream (s.u.) nicht direkt den nginx-Server stoppt, falls pythonapp noch nicht soweit ist
|
||||
# https://sandro-keil.de/blog/let-nginx-start-if-upstream-host-is-unavailable-or-down/
|
||||
|
||||
location /static {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
location / {
|
||||
# Variable muss benutzt werden (s.o. bei resolver Direktive)
|
||||
set $upstream pythonapp:8080;
|
||||
proxy_pass http://$upstream;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /health-check {
|
||||
add_header Content-Type text/plain;
|
||||
return 200 "success $time_iso8601";
|
||||
}
|
||||
}
|
||||
+33
-28
@@ -1,28 +1,33 @@
|
||||
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:
|
||||
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/configtemplates:ro
|
||||
- ${NGINX_CERTS}:/etc/certs
|
||||
environment:
|
||||
- NGINX_USE_SSL=${NGINX_USE_SSL:-true}
|
||||
- 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:
|
||||
+22
-24
@@ -1,24 +1,22 @@
|
||||
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:
|
||||
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}
|
||||
environment:
|
||||
# Globales Vibe-Home innerhalb des Workspace-Bind-Mounts, damit es auf dem Host persistiert
|
||||
- VIBE_HOME=/usr/opt/pythonapp/.vibe-global
|
||||
volumes:
|
||||
- ${PYTHON_DEV_DIR}:/usr/opt/pythonapp
|
||||
# - ${TYPESCRIPT_SRC_DIR}:/usr/opt/typescript
|
||||
- node-modules:/usr/opt/typescript/node_modules
|
||||
|
||||
volumes:
|
||||
node-modules:
|
||||
@@ -9,9 +9,10 @@ services:
|
||||
- ${NGINX_HOST_PORT}:4430
|
||||
volumes:
|
||||
- ${NGINX_STATIC_DIR}:/usr/share/nginx/html:ro
|
||||
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/templates
|
||||
- ${NGINX_CONFIG_TEMPLATE_DIR}:/etc/nginx/configtemplates:ro
|
||||
- ${NGINX_CERTS}:/etc/certs
|
||||
environment:
|
||||
- NGINX_USE_SSL=${NGINX_USE_SSL:-true}
|
||||
- NGINX_CERT=${NGINX_CERT}
|
||||
- NGINX_CERT_KEY=${NGINX_CERT_KEY}
|
||||
- NGINX_SERVER_NAME=${NGINX_SERVER_NAME}
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
# Parameter für NGINX-Server
|
||||
NGINX_VERSION=mainline-alpine
|
||||
NGINX_USE_SSL=true # true = SSL aktivieren, false = SSL deaktivieren, Port sollte auch angepasst werden
|
||||
NGINX_HOST_PORT=443
|
||||
NGINX_SERVER_NAME=kbp_crm.mylocal.de
|
||||
NGINX_STATIC_DIR=/home/schoschi/Entwicklung/Projekte_Runden/kbcrm/NGINX_Server/html
|
||||
@@ -55,4 +56,4 @@ ZITADEL_SCOPES=openid,profile,email
|
||||
# SMTP_USERNAME=
|
||||
# SMTP_PASSWORD=
|
||||
# SMTP_USE_TLS=true
|
||||
# EMAIL_FROM=formeleon@yourdomain.com
|
||||
# EMAIL_FROM=formeleon@yourdomain.com
|
||||
Reference in new issue
Block a user