Skip to content

Commit 9b4c2e5

Browse files
committed
docs: add README (EN/RU) and screenshots. chore: update compose and workflow
1 parent 00cc623 commit 9b4c2e5

File tree

6 files changed

+464
-27
lines changed

6 files changed

+464
-27
lines changed
Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,52 @@
11
name: Docker Compose Test
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
workflow_dispatch:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
workflow_dispatch: {}
98

109
jobs:
11-
compose-up:
12-
runs-on: ubuntu-latest
13-
14-
```
15-
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v4
18-
19-
- name: Set up Docker Buildx
20-
uses: docker/setup-buildx-action@v3
21-
22-
- name: Install docker-compose
23-
run: |
24-
apt-get update && apt-get install -y docker-compose
25-
26-
- name: Build and run docker-compose
27-
run: |
28-
docker-compose -f docker-compose.yml up -d --build
29-
docker-compose ps
30-
docker-compose down
31-
```
10+
compose-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Validate Docker Compose
18+
run: docker compose config
19+
20+
- name: Validate Prometheus config
21+
run: |
22+
# Скачиваем promtool прямо в workflow
23+
curl -sSL https://github.com/prometheus/prometheus/releases/download/v2.48.0/prometheus-2.48.0.linux-amd64.tar.gz | tar -xz
24+
./prometheus-2.48.0.linux-amd64/promtool check config ./prometheus/config/prometheus.yml
25+
26+
- name: Build services
27+
run: docker compose build
28+
29+
- name: Start services
30+
run: docker compose up -d
31+
32+
- name: Wait for containers to initialize
33+
run: sleep 20
34+
35+
- name: Check service health
36+
run: |
37+
set -e
38+
services=("prometheus" "grafana" "nginx" "alertmanager")
39+
for svc in "${services[@]}"; do
40+
status=$(docker inspect -f '{{.State.Health.Status}}' "$svc" 2>/dev/null || echo "unknown")
41+
if [[ "$status" != "healthy" ]]; then
42+
echo "❌ $svc container is not healthy!"
43+
docker logs "$svc" || true
44+
exit 1
45+
else
46+
echo "✅ $svc container is healthy"
47+
fi
48+
done
49+
50+
- name: Stop services
51+
if: always()
52+
run: docker compose down

README.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
![Build Status](https://img.shields.io/github/actions/workflow/status/DanLinX2004X/monitron/docker-compose-test.yml?branch=main)
2+
![License](https://img.shields.io/badge/license-MIT-green)
3+
![Docker](https://img.shields.io/badge/docker-compose-v2.15-blue)
4+
![Prometheus](https://img.shields.io/badge/prometheus-v2.48-orange)
5+
![Grafana](https://img.shields.io/badge/grafana-10.2-purple)
6+
![Alertmanager](https://img.shields.io/badge/alertmanager-active-red)
7+
![GitHub Actions](https://img.shields.io/badge/GitHub_Actions-2088FF?logo=github-actions)
8+
9+
# 🚀 Monitron
10+
11+
Personal Monitoring Stack for developers and DevOps engineers.
12+
13+
Monitron is a ready-to-use monitoring stack that helps you collect, analyze, and visualize metrics from your applications and infrastructure.
14+
Perfect for pet projects, home labs, and DevOps practice environments.
15+
16+
---
17+
18+
## ✨ Features
19+
20+
- 📊 Metrics collection — Prometheus for time-series data storage
21+
- 📈 Visualization — Grafana dashboards ready to use
22+
- 🚨 Alerting — Alertmanager with Telegram integration
23+
- 🖥 System monitoring — Node Exporter for host metrics
24+
- 🌐 Web monitoring — Nginx + Exporter for web server stats
25+
- 🔄 CI/CD — automatic configuration validation and build tests
26+
27+
---
28+
29+
## 🛠 Stack Components
30+
31+
| Component | Version | Description |
32+
|------------|----------|-------------|
33+
| Prometheus | 2.48 | Metrics collection & storage |
34+
| Grafana | 10.2 | Visualization & dashboards |
35+
| Alertmanager || Alert routing & notifications |
36+
| Node Exporter || Host-level metrics |
37+
| Docker Compose | 2.15 | Container orchestration |
38+
| GitHub Actions || CI/CD automation |
39+
40+
---
41+
42+
## 🚀 Quick Start
43+
44+
```bash
45+
# 1. Clone the repository
46+
git clone https://github.com/DanLinX2004X/monitron.git
47+
cd monitron
48+
49+
# 2. Create an .env file from the template
50+
cp .env.example .env
51+
52+
# 3. Launch the monitoring stack
53+
docker compose up -d --build
54+
55+
# 4. Check running services
56+
docker compose ps
57+
```
58+
59+
---
60+
61+
## 🔗 Service Access
62+
63+
Service URL Login
64+
65+
Grafana http://localhost:3000 admin / admin
66+
Prometheus http://localhost:9090
67+
Alertmanager http://localhost:9093
68+
Nginx http://localhost:8080
69+
70+
P.S. Login and password are required to log in to Grafana. When you open it for the first time, it will be admin/ admin (login and password match), after that Grafana will ask you to change the password.
71+
72+
---
73+
74+
## 📦 Stop Services
75+
76+
```
77+
docker compose down
78+
```
79+
80+
---
81+
82+
⚙️ Alertmanager & Telegram Integration
83+
84+
The .env.example file contains variables for Telegram notification setup:
85+
86+
```text
87+
TELEGRAM_BOT_TOKEN=123456789:ABCDEF123456789
88+
TELEGRAM_CHAT_ID=123456789
89+
```
90+
91+
Once filled in, Alertmanager will automatically send alerts to your Telegram chat.
92+
93+
94+
---
95+
96+
## 📊 Grafana Dashboards
97+
98+
System Overview — CPU, memory, disk, network
99+
100+
Nginx Analytics — requests, connections, errors
101+
102+
103+
104+
---
105+
106+
## 🏗 Project Structure
107+
108+
```text
109+
monitron/
110+
├── 📁 prometheus/
111+
│ ├── config/
112+
│ │ ├── prometheus.yml # Main configuration
113+
│ │ └── alert.rules.yml # Alert rules
114+
│ └── data/ # Time series data
115+
├── 📁 grafana/
116+
│ └── provisioning/ # Auto setup files
117+
├── 📁 nginx/
118+
│ ├── html/
119+
│ │ └── index.html # Demo page
120+
│ └── nginx.conf # Web server config
121+
├── 📁 screenshots/ # Screenshots for documentation
122+
│ ├── system_dashboard.png
123+
│ └── nginx_monitoring.png
124+
├── 🐳 docker-compose.yml # Main Docker Compose file
125+
├── 📜 .env.example # Environment variables
126+
├── 📘 README.md # Documentation (RU)
127+
└── 📘 README.en.md # Documentation (EN)
128+
```
129+
130+
---
131+
132+
## 🔄 CI/CD Pipeline
133+
134+
Automated workflow using GitHub Actions:
135+
136+
✅ Docker Compose syntax validation
137+
138+
✅ Prometheus config validation (promtool check config)
139+
140+
✅ Health check of running containers
141+
142+
✅ Build and deploy verification
143+
144+
145+
146+
---
147+
148+
## ⚠️ Local Testing with act
149+
150+
You can run the pipeline locally using:
151+
152+
```bash
153+
act -j validate
154+
```
155+
156+
> ⚠️ Note: act has known limitations (network isolation, health-checks, volume mapping).
157+
For reliable testing — use real GitHub Actions runners.
158+
159+
160+
---
161+
162+
📸 Screenshots
163+
164+
System Dashboard
165+
![[screenshots/system_dashboard.png]]
166+
167+
168+
169+
Nginx Monitoring
170+
![[screenshots/nginx_monitoring.png]]
171+
172+
173+
174+
175+
---
176+
177+
🤝 Contributing
178+
179+
1. Fork the repository
180+
181+
182+
2. Create a feature branch: git checkout -b feature/amazing-feature
183+
184+
185+
3. Commit changes: git commit -m 'Add amazing feature'
186+
187+
188+
4. Push the branch: git push origin feature/amazing-feature
189+
190+
191+
5. Open a Pull Request
192+
193+
194+
195+
196+
---
197+
198+
📄 License
199+
200+
Distributed under the MIT License.
201+
202+
203+
---
204+
205+
👤 Author
206+
207+
DanLinX2004X
208+

0 commit comments

Comments
 (0)