fixing client

This commit is contained in:
stefan
2025-09-15 17:48:57 +02:00
parent f9d492c7e0
commit ea560fc221
30 changed files with 3632 additions and 525 deletions
+79 -92
View File
@@ -2,104 +2,91 @@
# Docker Compose - Client Applications
# Meldestelle Project - Frontend Components
# ===================================================================
# Usage:
# Mit Services: docker-compose -f docker-compose.yml -f docker-compose.services.yml -f docker-compose.clients.yml up -d
# Nur Frontend: docker-compose -f docker-compose.yml -f docker-compose.clients.yml up -d
# Usage Scenarios:
#
# 1. STANDALONE CLIENT DEPLOYMENT (Fixed):
# docker-compose -f docker-compose.clients.yml up -d
# - Clients run independently without api-gateway dependency
# - Set GATEWAY_HOST environment variable to external API Gateway
# - Example: GATEWAY_HOST=localhost docker-compose -f docker-compose.clients.yml up -d
#
# 2. MULTI-FILE WITH INFRASTRUCTURE:
# docker-compose -f docker-compose.yml -f docker-compose.clients.yml up -d
# - Infrastructure services (api-gateway, postgres, etc.) start first
# - Clients connect to api-gateway in same network
#
# 3. COMPLETE SYSTEM:
# docker-compose -f docker-compose.yml -f docker-compose.services.yml -f docker-compose.clients.yml up -d
# - Full stack: Infrastructure + Backend Services + Frontend Clients
# ===================================================================
services:
# ===================================================================
# Web Application (Compose for Web)
# ===================================================================
web-app:
build:
context: .
dockerfile: dockerfiles/clients/web-app/Dockerfile
args:
# Global build arguments (from docker/build-args/global.env)
GRADLE_VERSION: ${DOCKER_GRADLE_VERSION:-9.0.0}
JAVA_VERSION: ${DOCKER_JAVA_VERSION:-21}
BUILD_DATE: ${BUILD_DATE}
VERSION: ${DOCKER_APP_VERSION:-1.0.0}
# Client-specific arguments (from docker/build-args/clients.env)
NODE_VERSION: ${DOCKER_NODE_VERSION:-20.11.0}
NGINX_VERSION: ${DOCKER_NGINX_VERSION:-1.25-alpine}
# Application-specific arguments
CLIENT_PATH: client
CLIENT_MODULE: client
CLIENT_NAME: meldestelle-web-app
container_name: meldestelle-web-app
environment:
NODE_ENV: ${NODE_ENV:-production}
API_BASE_URL: http://api-gateway:${GATEWAY_PORT:-8081}
WS_URL: ws://api-gateway:${GATEWAY_PORT:-8081}/ws
APP_TITLE: ${APP_NAME:-Meldestelle}
APP_VERSION: ${APP_VERSION:-1.0.0}
# Development specific
WEBPACK_DEV_SERVER_HOST: 0.0.0.0
WEBPACK_DEV_SERVER_PORT: 4000
ports:
- "4000:4000"
networks:
- meldestelle-network
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.web-app.rule=Host(`localhost`) && PathPrefix(`/`)"
- "traefik.http.services.web-app.loadbalancer.server.port=4000"
# ===================================================================
# Web Application (Kotlin/JS + Nginx)
# ===================================================================
web-app:
build:
context: .
dockerfile: dockerfiles/clients/web-app/Dockerfile
container_name: meldestelle-web-app
environment:
NODE_ENV: ${NODE_ENV:-production}
APP_TITLE: ${APP_NAME:-Meldestelle}
APP_VERSION: ${APP_VERSION:-1.0.0}
ports:
- "4000:4000"
networks:
- meldestelle-network
# depends_on removed for standalone client deployment
# When using multi-file setup, api-gateway dependency is handled externally
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.web-app.rule=Host(`localhost`) && PathPrefix(`/`)"
- "traefik.http.services.web-app.loadbalancer.server.port=4000"
# ===================================================================
# Desktop Application (Compose Desktop with VNC)
# Desktop Application (Kotlin Desktop + VNC)
# ===================================================================
# desktop-app:
# build:
# context: .
# dockerfile: dockerfiles/clients/desktop-app/Dockerfile
# args:
# # Global build arguments (from docker/build-args/global.env)
# GRADLE_VERSION: ${DOCKER_GRADLE_VERSION:-9.0.0}
# JAVA_VERSION: ${DOCKER_JAVA_VERSION:-21}
# BUILD_DATE: ${BUILD_DATE}
# VERSION: ${DOCKER_APP_VERSION:-1.0.0}
# # Client-specific arguments (from docker/build-args/clients.env)
# NODE_VERSION: ${DOCKER_NODE_VERSION:-20.11.0}
# # Application-specific arguments
# CLIENT_PATH: client
# CLIENT_MODULE: client
# CLIENT_NAME: meldestelle-desktop-app
# container_name: meldestelle-desktop-app
# environment:
# NODE_ENV: ${NODE_ENV:-production}
# API_BASE_URL: http://api-gateway:${GATEWAY_PORT:-8081}
# APP_TITLE: ${APP_NAME:-Meldestelle}
# APP_VERSION: ${APP_VERSION:-1.0.0}
# # VNC Configuration
# DISPLAY: ":99"
# VNC_PORT: "5901"
# NOVNC_PORT: "6080"
# ports:
# - "6080:6080" # Web-based VNC (noVNC)
# - "5901:5901" # VNC direct access
# networks:
# - meldestelle-network
# healthcheck:
# test: [ "CMD", "/opt/health-check.sh" ]
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 60s
# restart: unless-stopped
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.desktop-app.rule=Host(`localhost`) && PathPrefix(`/desktop`)"
# - "traefik.http.services.desktop-app.loadbalancer.server.port=6080"
desktop-app:
build:
context: .
dockerfile: dockerfiles/clients/desktop-app/Dockerfile
container_name: meldestelle-desktop-app
environment:
# API Configuration - fallback to external gateway if not in same compose network
API_BASE_URL: http://${GATEWAY_HOST:-api-gateway}:${GATEWAY_PORT:-8081}
# VNC Configuration
DISPLAY: ":99"
VNC_PORT: "5901"
NOVNC_PORT: "6080"
# App Information
APP_TITLE: ${APP_NAME:-Meldestelle}
APP_VERSION: ${APP_VERSION:-1.0.0}
ports:
- "6080:6080" # Web-based VNC (noVNC)
- "5901:5901" # VNC direct access
networks:
- meldestelle-network
# depends_on removed for standalone client deployment
# When using multi-file setup, api-gateway dependency is handled externally
healthcheck:
test: [ "CMD", "/opt/health-check.sh" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.desktop-app.rule=Host(`localhost`) && PathPrefix(`/desktop`)"
- "traefik.http.services.desktop-app.loadbalancer.server.port=6080"
# ===================================================================
# Auth Server (Custom Keycloak Extension)