mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-14 05:32:52 +08:00
🔧 Add Docker Compose configuration for PostgreSQL, Redis, and monitoring stack
This commit is contained in:
parent
bc2e06a9ec
commit
5a0af6a64b
67
docker-compose-dev.yml
Normal file
67
docker-compose-dev.yml
Normal file
@ -0,0 +1,67 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:15
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: zhenxun
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
labels:
|
||||
- "prometheus.io/scrape=true"
|
||||
- "prometheus.io/port=9187"
|
||||
|
||||
postgres-exporter:
|
||||
image: prometheuscommunity/postgres-exporter
|
||||
environment:
|
||||
DATA_SOURCE_NAME: "postgresql://postgres:password@db:5432/zhenxun?sslmode=disable"
|
||||
ports:
|
||||
- "9187:9187"
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
ports:
|
||||
- "6379:6379"
|
||||
labels:
|
||||
- "prometheus.io/scrape=true"
|
||||
- "prometheus.io/port=9121"
|
||||
|
||||
redis-exporter:
|
||||
image: oliver006/redis_exporter
|
||||
environment:
|
||||
REDIS_ADDR: redis://redis:6379
|
||||
ports:
|
||||
- "9121:9121"
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
- prometheus_data:/prometheus
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
||||
- '--web.console.templates=/etc/prometheus/consoles'
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
depends_on:
|
||||
- prometheus
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
prometheus_data:
|
||||
grafana_data:
|
||||
Loading…
Reference in New Issue
Block a user