diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml index 291b58c..0af71b2 100644 --- a/.gitea/workflows/cd.yml +++ b/.gitea/workflows/cd.yml @@ -37,10 +37,14 @@ jobs: NGINX_PORT=80 EOF - - name: Seed Prometheus config + - name: Seed Prometheus config on remote host + env: + DOCKER_HOST: tcp://192.168.88.40:2375 run: | - mkdir -p monitoring/prometheus - cat > monitoring/prometheus/prometheus.yml << 'EOF' + docker run --rm \ + -v prometheus-config:/etc/prometheus \ + alpine:latest sh -c ' + cat > /etc/prometheus/prometheus.yml << "PROMEOF" global: scrape_interval: 15s evaluation_interval: 15s @@ -49,29 +53,29 @@ jobs: - "/etc/prometheus/alerts.yml" scrape_configs: - - job_name: 'chat' + - job_name: "chat" static_configs: - - targets: ['chat:3000'] - - job_name: 'playout' + - targets: ["chat:3000"] + - job_name: "playout" static_configs: - - targets: ['playout:8081'] - - job_name: 'nginx' + - targets: ["playout:8081"] + - job_name: "nginx" static_configs: - - targets: ['nginx-exporter:9113'] - - job_name: 'redis' + - targets: ["nginx-exporter:9113"] + - job_name: "redis" static_configs: - - targets: ['redis-exporter:9121'] - - job_name: 'postgres' + - targets: ["redis-exporter:9121"] + - job_name: "postgres" static_configs: - - targets: ['postgres-exporter:9187'] - - job_name: 'node' + - targets: ["postgres-exporter:9187"] + - job_name: "node" static_configs: - - targets: ['node-exporter:9100'] - - job_name: 'prometheus' + - targets: ["node-exporter:9100"] + - job_name: "prometheus" static_configs: - - targets: ['localhost:9090'] - EOF - cat > monitoring/prometheus/alerts.yml << 'EOF' + - targets: ["localhost:9090"] + PROMEOF + cat > /etc/prometheus/alerts.yml << "ALERTSEOF" groups: - name: linearvoid rules: @@ -117,7 +121,8 @@ jobs: severity: warning annotations: summary: "Low disk space" - EOF + ALERTSEOF + ' - name: Deploy with docker-compose env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb90c2..e9f98fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ - **Tag format**: Standardized on `*.*.*` (e.g. `1.0.9`), removed `v` prefix from existing tags. - **DEPLOYMENT.md**: Documented parallel CI/CD pipeline flow with workflow table. +### Fixed + +- **Prometheus config mount**: Switched prod from bind mounts to named volume `prometheus-config`, populated via `docker run` on remote host. Fixes `not a directory` error when bind source path doesn't exist on deployment host. + ### Removed - `.github/MEMORY.md`, `.github/agents/`, `.github/instructions/` — tracking files migrated out of repo. diff --git a/README.md b/README.md index 8d41efa..e1c3068 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Build Status](https://git.allucanget.biz/zwitschi/linearvoid/actions/workflows/ci.yml/badge.svg)](https://git.allucanget.biz/zwitschi/linearvoid/actions) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Gitea](https://img.shields.io/badge/Gitea-1.27.1-blue)](https://git.allucanget.biz) -[![Version](https://img.shields.io/badge/version-1.0.6-blue)](https://git.allucanget.biz/zwitschi/linearvoid/releases) +[![Version](https://img.shields.io/badge/version-1.0.9-blue)](https://git.allucanget.biz/zwitschi/linearvoid/releases) [![Release Notes](https://img.shields.io/badge/release-notes-green)](CHANGELOG.md) ## Architecture diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 23e78d0..f6d15f8 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -159,8 +159,7 @@ services: container_name: linearvoid-prometheus restart: unless-stopped volumes: - - ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml - - ./monitoring/prometheus/alerts.yml:/etc/prometheus/alerts.yml + - prometheus-config:/etc/prometheus - prometheus-data:/prometheus ports: - "9090:9090" @@ -199,5 +198,6 @@ networks: volumes: redis-data: postgres-data: + prometheus-config: prometheus-data: grafana-data: