meldestelle/dc-ops.yaml

158 lines
4.9 KiB
YAML

name: "${PROJECT_NAME:-meldestelle}"
services:
# ==========================================
# 4. OPS & TOOLS (Monitoring & Admin)
# ==========================================
# --- EMAIL TESTING: Mailpit ---
mailpit:
image: "${MAILPIT_IMAGE:-axllent/mailpit:v1.29}"
container_name: "${PROJECT_NAME:-meldestelle}-mailpit"
restart: unless-stopped
ports:
- "${MAILPIT_WEB_PORT:-8025:8025}" # Web UI
- "${MAILPIT_SMTP_PORT:-1025:1025}" # SMTP Port
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:8025/" ]
interval: 10s
timeout: 5s
retries: 3
networks:
meldestelle-network:
aliases:
- "mailpit"
profiles: [ "dev-tools", "all" ]
# --- DATENBANK-MANAGEMENT-TOOL: pgAdmin4 ---
pgadmin:
image: "${PGADMIN_IMAGE:-dpage/pgadmin4:8}"
container_name: "${PROJECT_NAME:-meldestelle}-pgadmin"
restart: unless-stopped
profiles: [ "tools", "all" ]
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"
- "./config/docker/pgadmin/servers.json:/pgadmin4/servers.json:ro"
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:80/" ]
interval: 30s
timeout: 10s
retries: 3
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: unless-stopped
profiles: [ "ops", "all" ]
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"
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:9187/metrics" ]
interval: 10s
timeout: 5s
retries: 3
networks:
meldestelle-network:
aliases:
- "postgres-exporter"
# --- MONITORING: Alertmanager ---
alertmanager:
image: "${ALERTMANAGER_IMAGE:-prom/alertmanager:v0.29.0}"
container_name: "${PROJECT_NAME:-meldestelle}-alertmanager"
restart: unless-stopped
ports:
- "${ALERTMANAGER_PORT:-9093:9093}"
volumes:
- "./config/docker/monitoring/alertmanager/alertmanager.yaml:/etc/alertmanager/alertmanager.yaml:Z"
command:
- --config.file=/etc/alertmanager/alertmanager.yaml
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:9093/-/healthy" ]
interval: 30s
timeout: 10s
retries: 3
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: unless-stopped
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: unless-stopped
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