Init
This commit is contained in:
39
caddy/Caddyfile
Normal file
39
caddy/Caddyfile
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
admin 0.0.0.0:2019 {
|
||||
origins caddymanager-backend:8080
|
||||
}
|
||||
servers {
|
||||
metrics
|
||||
}
|
||||
log {
|
||||
output file /var/log/caddy/caddy.log
|
||||
format json
|
||||
}
|
||||
}
|
||||
|
||||
# Beispiel für deine Domain
|
||||
example.com {
|
||||
reverse_proxy internal-service:8080
|
||||
log {
|
||||
output file output file /var/log/caddy/access.log {
|
||||
roll_size 100MiB
|
||||
roll_keep 5
|
||||
roll_keep_for 100d
|
||||
}
|
||||
format json
|
||||
level INFO
|
||||
}
|
||||
}
|
||||
|
||||
grafana.domaine.com {
|
||||
reverse_proxy grafana:3000
|
||||
log {
|
||||
output file /var/log/caddy/grafana.domain.com.log {
|
||||
roll_size 100MiB
|
||||
roll_keep 5
|
||||
roll_keep_for 100d
|
||||
}
|
||||
format json
|
||||
level INFO
|
||||
}
|
||||
}
|
||||
0
caddy/config/info.txt
Normal file
0
caddy/config/info.txt
Normal file
0
caddy/data/info.txt
Normal file
0
caddy/data/info.txt
Normal file
0
caddy/log/info.txt
Normal file
0
caddy/log/info.txt
Normal file
0
caddymanager-backend/data/info.txt
Normal file
0
caddymanager-backend/data/info.txt
Normal file
92
docker-compose.yml
Normal file
92
docker-compose.yml
Normal file
@@ -0,0 +1,92 @@
|
||||
services:
|
||||
caddy:
|
||||
image: caddy:latest
|
||||
container_name: caddy
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
|
||||
- ./caddy/data:/data
|
||||
- ./caddy/config:/config
|
||||
- ./caddy/log:/var/log/caddy
|
||||
networks:
|
||||
- monitor-net
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
volumes:
|
||||
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
networks:
|
||||
- monitor-net
|
||||
|
||||
loki:
|
||||
image: grafana/loki:latest
|
||||
container_name: loki
|
||||
volumes:
|
||||
- ./loki/loki-config.yml:/etc/loki/local-config.yaml
|
||||
command: -config.file=/etc/loki/local-config.yaml
|
||||
networks:
|
||||
- monitor-net
|
||||
|
||||
promtail:
|
||||
image: grafana/promtail:latest
|
||||
container_name: promtail
|
||||
volumes:
|
||||
- ./caddy/log:/var/log/caddy
|
||||
- ./promtail/promtail-config.yml:/etc/promtail/config.yml
|
||||
command: -config.file=/etc/promtail/config.yml
|
||||
networks:
|
||||
- monitor-net
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
- monitor-net
|
||||
|
||||
backend:
|
||||
image: caddymanager/caddymanager-backend:latest
|
||||
container_name: caddymanager-backend
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PORT=3000
|
||||
- DB_ENGINE=sqlite
|
||||
- SQLITE_DB_PATH=/app/data/caddymanager.sqlite
|
||||
- CORS_ORIGIN=*
|
||||
- LOG_LEVEL=debug
|
||||
- CADDY_SANDBOX_URL=http://caddy:2019
|
||||
- PING_INTERVAL=30000
|
||||
- PING_TIMEOUT=2000
|
||||
- AUDIT_LOG_MAX_SIZE_MB=100
|
||||
- AUDIT_LOG_RETENTION_DAYS=90
|
||||
- METRICS_HISTORY_MAX=1000
|
||||
- JWT_SECRET=your_jwt_secret_key_here
|
||||
- JWT_EXPIRATION=24h
|
||||
volumes:
|
||||
- ./caddymanager-backend/data:/app/data
|
||||
networks:
|
||||
- monitor-net
|
||||
|
||||
frontend:
|
||||
image: caddymanager/caddymanager-frontend:latest
|
||||
container_name: caddymanager-frontend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- backend
|
||||
environment:
|
||||
- BACKEND_HOST=backend:3000
|
||||
- APP_NAME=Caddy Manager
|
||||
- DARK_MODE=true
|
||||
ports:
|
||||
- 9080:80
|
||||
networks:
|
||||
- monitor-net
|
||||
|
||||
networks:
|
||||
monitor-net:
|
||||
driver: bridge
|
||||
2473
grafana/dashboard.json
Normal file
2473
grafana/dashboard.json
Normal file
File diff suppressed because it is too large
Load Diff
46
loki/loki-config.yml
Normal file
46
loki/loki-config.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
auth_enabled: false
|
||||
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
grpc_listen_port: 9096
|
||||
|
||||
common:
|
||||
instance_addr: 127.0.0.1
|
||||
path_prefix: /tmp/loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /tmp/loki/chunks
|
||||
rules_directory: /tmp/loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
kvstore:
|
||||
store: inmemory
|
||||
|
||||
query_range:
|
||||
results_cache:
|
||||
cache:
|
||||
embedded_cache:
|
||||
enabled: true
|
||||
max_size_mb: 100
|
||||
|
||||
schema_config:
|
||||
configs:
|
||||
- from: 2020-10-24
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
||||
limits_config:
|
||||
allow_structured_metadata: true
|
||||
reject_old_samples: true
|
||||
reject_old_samples_max_age: 168h
|
||||
|
||||
chunk_store_config:
|
||||
max_look_back_period: 0s
|
||||
|
||||
table_manager:
|
||||
retention_deletes_enabled: false
|
||||
retention_period: 0s
|
||||
27
prometheus/prometheus.yml
Normal file
27
prometheus/prometheus.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
external_labels:
|
||||
monitor: 'example'
|
||||
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets: ['localhost:9093']
|
||||
|
||||
scrape_configs:
|
||||
|
||||
- job_name: 'prometheus'
|
||||
scrape_interval: 5s
|
||||
scrape_timeout: 5s
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: node
|
||||
static_configs:
|
||||
- targets: ['localhost:9100']
|
||||
|
||||
- job_name: caddy
|
||||
static_configs:
|
||||
- targets: ['caddy:2019']
|
||||
35
promtail/promtail-config.yml
Normal file
35
promtail/promtail-config.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
server:
|
||||
http_listen_port: 9080
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
filename: /tmp/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://loki:3100/loki/api/v1/push
|
||||
|
||||
scrape_configs:
|
||||
- job_name: system
|
||||
static_configs:
|
||||
- targets:
|
||||
- localhost
|
||||
labels:
|
||||
job: varlogs
|
||||
__path__: /var/log/messages
|
||||
|
||||
- job_name: caddy
|
||||
static_configs:
|
||||
- targets:
|
||||
- localhost
|
||||
labels:
|
||||
job: caddy
|
||||
__path__: /var/log/caddy/*log
|
||||
agent: caddy-promtail
|
||||
pipeline_stages:
|
||||
- json:
|
||||
expressions:
|
||||
duration: duration
|
||||
status: status
|
||||
- labels:
|
||||
duration:
|
||||
status:
|
||||
Reference in New Issue
Block a user