Skip to content

Commit

Permalink
feat: update docker-compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
bendanzhentan committed Feb 3, 2024
1 parent 8db905f commit 4b3b689
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 18 deletions.
18 changes: 0 additions & 18 deletions docker-compose.yml

This file was deleted.

43 changes: 43 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: '3.8'

services:
mysql:
image: mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=db_password
- MYSQL_DATABASE=db_name
- MYSQL_USER=db_username
- MYSQL_PASSWORD=db_password
command: --default-authentication-plugin=mysql_native_password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql

prometheus:
image: prom/prometheus
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- 9090:9090
restart: unless-stopped
volumes:
- ./prometheus:/etc/prometheus
- prom_data:/prometheus

grafana:
image: grafana/grafana
container_name: grafana
ports:
- 3000:3000
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
volumes:
- ./grafana:/etc/grafana/provisioning/datasources

volumes:
mysql_data:
prom_data:
9 changes: 9 additions & 0 deletions docker/grafana/datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
editable: true
21 changes: 21 additions & 0 deletions docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
api_version: v1
scrape_configs:
- job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090

0 comments on commit 4b3b689

Please sign in to comment.