Last active
June 7, 2025 17:55
-
-
Save AjayPoshak/1fc2dccb6918175f51d448ef9996e151 to your computer and use it in GitHub Desktop.
logs server compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker-compose.yml for log-server | |
services: | |
loki: | |
image: grafana/loki:2.8.0 | |
ports: | |
- "3100:3100" | |
volumes: | |
- loki-data:/loki | |
restart: unless-stopped | |
grafana: | |
image: grafana/grafana:latest | |
ports: | |
- "3000:3000" | |
volumes: | |
- grafana-data:/var/lib/grafana | |
environment: | |
- GF_SECURITY_ADMIN_PASSWORD=<your-password> | |
restart: unless-stopped | |
prometheus: | |
image: prom/prometheus:latest | |
container_name: prometheus | |
restart: unless-stopped | |
volumes: | |
- ./prometheus.yml:/etc/prometheus/prometheus.yml | |
- prometheus_data:/prometheus | |
ports: | |
- "9090:9090" | |
volumes: | |
loki-data: | |
grafana-data: | |
prometheus_data: |
loki-config.yml
auth_enabled: false
server:
http_listen_port: 3100
common:
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
limits_config:
retention_period: 7d
ingestion_rate_mb: 4
ingestion_burst_size_mb: 6
compactor:
retention_enabled: true
table_manager:
retention_deletes_enabled: true
retention_period: 7d
docker-compose.yml
services:
loki:
image: grafana/loki:2.8.0
command: -config.file=/etc/loki/config.yml
ports:
- "3100:3100"
volumes:
- loki-data:/loki
- ./loki-config.yml:/etc/loki/config.yml
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=<password>
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
volumes:
- $PWD/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
ports:
- "9090:9090"
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- "--path.rootfs=/rootfs"
ports:
- "9100:9100"
labels:
app: "logs-server"
environment: "production"
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "2"
volumes:
loki-data:
grafana-data:
prometheus_data:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With ability to monitor the "logs-server" node itself
docker-compose.yml
./prometheus.yml
./loki-config.yml