refactor: update docker images to use custom registry and optimize configurations
Switched container images in `dc-infra.yaml` to a custom Docker registry for better control and consistency across deployments. Added Keycloak with enhanced configurations and updated several container restart policies, memory allocations, and healthcheck settings for improved performance and compatibility.
This commit is contained in:
+57
-61
@@ -7,7 +7,7 @@ services:
|
||||
|
||||
# --- DATABASE: PostgreSQL ---
|
||||
postgres:
|
||||
image: "${POSTGRES_IMAGE:-postgres:16-alpine}"
|
||||
image: "${DOCKER_REGISTRY:-git.mo-code.at/Mocode-Software}/postgres:${POSTGRES_IMAGE:-postgres:16-alpine}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-postgres"
|
||||
# OPTIMIERUNG: Automatischer Neustart bei System-Reboot
|
||||
restart: unless-stopped
|
||||
@@ -46,7 +46,7 @@ services:
|
||||
# --- CACHE: Valkey (formerly Redis) ---
|
||||
valkey:
|
||||
# Valkey 9.0 (User Request)
|
||||
image: "${VALKEY_IMAGE:-valkey/valkey:9-alpine}"
|
||||
image: "${DOCKER_REGISTRY:-git.mo-code.at/Mocode-Software}/valkey:${VALKEY_IMAGE:-valkey/valkey:9-alpine}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-valkey"
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
@@ -77,11 +77,53 @@ services:
|
||||
aliases:
|
||||
- "valkey"
|
||||
|
||||
# --- IAM: Keycloak (DEBUG MODE) ---
|
||||
keycloak:
|
||||
# Wir nutzen jetzt dein optimiertes Image statt des Standard-Images
|
||||
build:
|
||||
context: .
|
||||
dockerfile: config/docker/keycloak/Dockerfile
|
||||
args:
|
||||
KEYCLOAK_IMAGE_TAG: "${KEYCLOAK_IMAGE_TAG:-26.4}"
|
||||
image: "${DOCKER_REGISTRY:-git.mo-code.at/Mocode-Software}/keycloak:${KEYCLOAK_IMAGE_TAG:-26.4}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-keycloak"
|
||||
restart: unless-stopped # Wichtig für Zora!
|
||||
environment:
|
||||
KC_BOOTSTRAP_ADMIN_USERNAME: "${KC_ADMIN_USERNAME:-kc-admin}"
|
||||
KC_BOOTSTRAP_ADMIN_PASSWORD: "${KC_ADMIN_PASSWORD:-kc-password}"
|
||||
KC_DB: "${KC_DB:-postgres}"
|
||||
KC_DB_SCHEMA: "${KC_DB_SCHEMA:-keycloak}"
|
||||
# SSoT: DB-URL dynamisch halten
|
||||
KC_DB_URL: "jdbc:postgresql://postgres:5432/${POSTGRES_DB:-meldestelle}"
|
||||
KC_DB_USERNAME: "${POSTGRES_USER:-meldestelle}"
|
||||
KC_DB_PASSWORD: "${POSTGRES_PASSWORD:-meldestelle}"
|
||||
KC_HOSTNAME: "${KC_HOSTNAME:-localhost}"
|
||||
KC_HTTP_ENABLED: "true"
|
||||
KC_PROXY_HEADERS: "xforwarded"
|
||||
KC_HEALTH_ENABLED: "true"
|
||||
KC_METRICS_ENABLED: "true"
|
||||
# OPTIMIERUNG: Java Heap Einstellungen
|
||||
JAVA_OPTS_APPEND: "-Xms${KC_HEAP_MIN:-512m} -Xmx${KC_HEAP_MAX:-1024m}"
|
||||
ports:
|
||||
- "${KC_PORT:-8180:8080}"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: "service_healthy"
|
||||
volumes:
|
||||
- "./config/docker/keycloak:/opt/keycloak/data/import:Z"
|
||||
# DYNAMISCH: start-dev für Dev, start für Zora
|
||||
command: "${KC_COMMAND:-start-dev --import-realm}"
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "keycloak"
|
||||
profiles: [ "infra", "all" ]
|
||||
|
||||
# --- SERVICE DISCOVERY: Consul ---
|
||||
consul:
|
||||
image: "${CONSUL_IMAGE:-hashicorp/consul:1.22.1}"
|
||||
image: "${DOCKER_REGISTRY:-git.mo-code.at/Mocode-Software}/consul:${CONSUL_IMAGE:-hashicorp/consul:1.22.1}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-consul"
|
||||
restart: no
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${CONSUL_PORT:-8500:8500}"
|
||||
- "${CONSUL_UDP_PORT:-8600:8600/udp}"
|
||||
@@ -89,8 +131,6 @@ services:
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8500/v1/status/leader" ]
|
||||
interval: "30s"
|
||||
timeout: "10s"
|
||||
retries: "3"
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
@@ -99,73 +139,29 @@ services:
|
||||
|
||||
# --- TRACING: Zipkin ---
|
||||
zipkin:
|
||||
image: "${ZIPKIN_IMAGE:-openzipkin/zipkin:3}"
|
||||
image: "${DOCKER_REGISTRY:-git.mo-code.at/Mocode-Software}/zipkin:${ZIPKIN_IMAGE:-openzipkin/zipkin:3}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-zipkin"
|
||||
restart: no
|
||||
restart: unless-stopped # Geändert für Zora
|
||||
environment:
|
||||
# OPTIMIERUNG: Speicherbegrenzung für Zora (Zipkin ist Java)
|
||||
JAVA_OPTS: "-Xms${ZIPKIN_HEAP:-256m} -Xmx${ZIPKIN_HEAP:-512m}"
|
||||
ports:
|
||||
- "${ZIPKIN_PORT:-9411:9411}"
|
||||
profiles: [ "infra", "all" ]
|
||||
profiles: [ "ops", "all" ] # Geändert auf 'ops', um es optionaler zu machen
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "zipkin"
|
||||
|
||||
# --- EMAIL TESTING: Mailpit ---
|
||||
mailpit:
|
||||
image: "axllent/mailpit"
|
||||
image: "${DOCKER_REGISTRY:-git.mo-code.at/Mocode-Software}/mailpit:${MAILPIT_IMAGE:-axllent/mailpit:v1.29}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-mailpit"
|
||||
restart: no
|
||||
restart: unless-stopped # Geändert für Zora
|
||||
ports:
|
||||
- "8025:8025" # Web UI
|
||||
- "1025:1025" # SMTP Port
|
||||
environment:
|
||||
MP_MAX_MESSAGES: 5000
|
||||
MP_DATABASE: /data/mailpit.db
|
||||
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
||||
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
||||
volumes:
|
||||
- "mailpit-data:/data"
|
||||
profiles: [ "infra", "all" ]
|
||||
- "${MAILPIT_WEB_PORT:-8025:8025}" # Web UI
|
||||
- "${MAILPIT_SMTP_PORT:-1025:1025}" # SMTP Port
|
||||
profiles: [ "dev-tools", "all" ] # Auf 'dev-tools' verschoben
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "mailpit"
|
||||
|
||||
# --- IAM: Keycloak (DEBUG MODE) ---
|
||||
keycloak:
|
||||
image: "quay.io/keycloak/keycloak:26.4"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-keycloak"
|
||||
restart: no
|
||||
environment:
|
||||
KC_BOOTSTRAP_ADMIN_USERNAME: "${KC_ADMIN_USERNAME:-kc-admin}"
|
||||
KC_BOOTSTRAP_ADMIN_PASSWORD: "${KC_ADMIN_PASSWORD:-kc-password}"
|
||||
KC_DB: "${KC_DB:-postgres}"
|
||||
KC_DB_SCHEMA: "${KC_DB_SCHEMA:-keycloak}"
|
||||
KC_DB_URL: "${POSTGRES_DB_URL:-jdbc:postgresql://postgres:5432/pg-meldestelle-db}"
|
||||
KC_DB_USERNAME: "${POSTGRES_USER:-pg-user}"
|
||||
KC_DB_PASSWORD: "${POSTGRES_PASSWORD:-pg-password}"
|
||||
KC_HOSTNAME: "${KC_HOSTNAME:-localhost}"
|
||||
KC_HTTP_ENABLED: "true"
|
||||
KC_PROXY_HEADERS: "xforwarded"
|
||||
KC_HEALTH_ENABLED: "true"
|
||||
KC_METRICS_ENABLED: "true"
|
||||
KC_LOG_LEVEL: "INFO"
|
||||
ports:
|
||||
- "${KC_PORT:-8180:8080}"
|
||||
- "${KC_DEBUG_PORT:-9000:9000}"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: "service_healthy"
|
||||
volumes:
|
||||
# Mount für den Import
|
||||
- "./config/docker/keycloak:/opt/keycloak/data/import:Z"
|
||||
# Import beim Start aktivieren
|
||||
command: "start-dev --import-realm"
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "keycloak"
|
||||
profiles: [ "infra", "all" ]
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
Reference in New Issue
Block a user