-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
78 lines (73 loc) · 2.36 KB
/
docker-compose.dev.yml
File metadata and controls
78 lines (73 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
services:
postgres:
image: "postgres"
container_name: "backend-template-postgres"
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "backend-template"
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql
restart: always
networks:
- backend-network
prometheus:
image: prom/prometheus:latest
container_name: backend-template-prometheus
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
environment:
- API_METRICS_TARGET=${API_METRICS_TARGET:-host.docker.internal:8000}
- ENVIRONMENT=${NODE_ENV:-development}
volumes:
- ./infra/monitoring/prometheus.yml:/etc/prometheus/prometheus.template.yml:ro
- prometheus-data:/prometheus
entrypoint: ["/bin/sh", "-c"]
command:
- |
sed 's|API_METRICS_TARGET_PLACEHOLDER|'"$$API_METRICS_TARGET"'|g; s|ENVIRONMENT_PLACEHOLDER|'"$$ENVIRONMENT"'|g' /etc/prometheus/prometheus.template.yml > /etc/prometheus/prometheus.yml
exec /bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --web.console.libraries=/etc/prometheus/console_libraries --web.console.templates=/etc/prometheus/consoles --web.enable-lifecycle
restart: unless-stopped
networks:
- backend-network
grafana:
image: grafana/grafana:latest
container_name: backend-template-grafana
ports:
- "${GRAFANA_PORT:-8001}:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana-data:/var/lib/grafana
- ./infra/monitoring/grafana/provisioning:/etc/grafana/provisioning
- ./infra/monitoring/grafana/dashboards:/var/lib/grafana/dashboards
restart: unless-stopped
networks:
- backend-network
depends_on:
- prometheus
- loki
loki:
image: grafana/loki:latest
container_name: backend-template-loki
ports:
- "${LOKI_PORT:-3100}:3100"
volumes:
- ./infra/monitoring/loki/loki-config.yml:/etc/loki/local-config.yaml:ro
- loki-data:/loki
command: -config.file=/etc/loki/local-config.yaml
restart: unless-stopped
networks:
- backend-network
volumes:
postgres-data:
prometheus-data:
grafana-data:
loki-data:
networks:
backend-network:
driver: bridge