kleinigkeiten für deploy prozess...
This commit is contained in:
1 parent
c1c92d1169
commit
96c9ceafc1
5 files changed
+45
-15
No files matched your search
@@ -4,3 +4,5 @@ node_modules
|
|||||||
tsout
|
tsout
|
||||||
kbp_crm*.js
|
kbp_crm*.js
|
||||||
App_Server/data/
|
App_Server/data/
|
||||||
|
.env
|
||||||
|
kbcrm
|
||||||
@@ -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
|
||||||
@@ -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:
|
||||||
@@ -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:
|
||||||
|
|||||||
@@ -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"
|
||||||
Reference in new issue
Block a user