chore(docker): modularize and restructure Docker Compose configuration
- Reorganized `docker-compose.yaml` by splitting it into modular files: `dc-infra.yaml`, `dc-backend.yaml`, `dc-gui.yaml`, and `dc-ops.yaml`. - Simplified structure by removing redundant `docker-compose.frontend.yaml` and `docker-compose.services.yaml` files. - Improved maintainability and modularity of service definitions across infrastructure, backend, GUI, and ops layers.
This commit is contained in:
+122
@@ -0,0 +1,122 @@
|
||||
name: "${PROJECT_NAME:-meldestelle}"
|
||||
|
||||
services:
|
||||
# ==========================================
|
||||
# 4. OPS & TOOLS (Monitoring & Admin)
|
||||
# ==========================================
|
||||
|
||||
# --- DATENBANK-MANAGEMENT-TOOL: pgAdmin4 ---
|
||||
pgadmin:
|
||||
image: "${PGADMIN_IMAGE:-dpage/pgadmin4:8}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-pgadmin"
|
||||
restart: no
|
||||
ports:
|
||||
- "${PGADMIN_PORT:-8888:80}"
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: "${PGADMIN_EMAIL:-meldestelle@mo-code.at}"
|
||||
PGADMIN_DEFAULT_PASSWORD: "${PGADMIN_PASSWORD:-pgadmin}"
|
||||
volumes:
|
||||
- "pgadmin-data:/var/lib/pgadmin"
|
||||
profiles: [ "tools", "all" ]
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "pgadmin"
|
||||
|
||||
# --- MONITORING: Postgres Exporter ---
|
||||
postgres-exporter:
|
||||
image: "${POSTGRES_EXPORTER_IMAGE:-prometheuscommunity/postgres-exporter:v0.18.0}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-postgres-exporter"
|
||||
restart: no
|
||||
environment:
|
||||
DATA_SOURCE_NAME: "postgresql://${POSTGRES_USER:-pg-user}:${POSTGRES_PASSWORD:-pg-password}@postgres:5432/${POSTGRES_DB:-pg-meldestelle-db}?sslmode=disable"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: "service_healthy"
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "postgres-exporter"
|
||||
profiles: [ "ops", "all" ]
|
||||
|
||||
# --- MONITORING: Alertmanager ---
|
||||
alertmanager:
|
||||
image: "${ALERTMANAGER_IMAGE:-prom/alertmanager:v0.29.0}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-alertmanager"
|
||||
restart: no
|
||||
ports:
|
||||
- "${ALERTMANAGER_PORT:-9093:9093}"
|
||||
volumes:
|
||||
- ./config/docker/monitoring/alertmanager/alertmanager.yaml:/etc/alertmanager/alertmanager.yaml
|
||||
command:
|
||||
- --config.file=/etc/alertmanager/alertmanager.yaml
|
||||
profiles: [ "ops", "all" ]
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "alertmanager"
|
||||
|
||||
# --- MONITORING: Prometheus ---
|
||||
prometheus:
|
||||
image: "${PROMETHEUS_IMAGE:-prom/prometheus:v3.7.3}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-prometheus"
|
||||
restart: no
|
||||
ports:
|
||||
- "${PROMETHEUS_PORT:-9090:9090}"
|
||||
volumes:
|
||||
- "prometheus-data:/prometheus"
|
||||
- "./config/docker/monitoring/prometheus:/etc/prometheus:Z"
|
||||
- "./config/docker/monitoring/prometheus/rules:/etc/prometheus/rules:Z"
|
||||
command:
|
||||
- --web.enable-lifecycle
|
||||
- --config.file=/etc/prometheus/prometheus.yaml
|
||||
- --storage.tsdb.retention.time=15d
|
||||
healthcheck:
|
||||
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:9090/-/healthy" ]
|
||||
interval: "30s"
|
||||
timeout: "10s"
|
||||
retries: "3"
|
||||
start_period: "30s"
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "prometheus"
|
||||
profiles: [ "ops", "all" ]
|
||||
|
||||
# --- MONITORING: Grafana ---
|
||||
grafana:
|
||||
image: "${GF_IMAGE:-grafana/grafana:12.3}"
|
||||
container_name: "${PROJECT_NAME:-meldestelle}-grafana"
|
||||
restart: no
|
||||
environment:
|
||||
GF_SECURITY_ADMIN_USER: "${GF_ADMIN_USER:-gf-admin}"
|
||||
GF_SECURITY_ADMIN_PASSWORD: "${GF_ADMIN_PASSWORD:-gf-password}"
|
||||
ports:
|
||||
- "${GF_PORT:-3000:3000}"
|
||||
volumes:
|
||||
- grafana-data:/var/lib/grafana
|
||||
- ./config/docker/monitoring/grafana/provisioning:/etc/grafana/provisioning:Z
|
||||
- ./config/docker/monitoring/grafana/dashboards:/var/lib/grafana/dashboards:Z
|
||||
depends_on:
|
||||
prometheus:
|
||||
condition: "service_healthy"
|
||||
healthcheck:
|
||||
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health" ]
|
||||
interval: "30s"
|
||||
timeout: "10s"
|
||||
retries: "3"
|
||||
start_period: "30s"
|
||||
networks:
|
||||
meldestelle-network:
|
||||
aliases:
|
||||
- "grafana"
|
||||
profiles: [ "ops", "all" ]
|
||||
|
||||
volumes:
|
||||
pgadmin-data:
|
||||
prometheus-data:
|
||||
grafana-data:
|
||||
|
||||
networks:
|
||||
meldestelle-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user