-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
115 lines (108 loc) · 3.7 KB
/
docker-compose.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
version: "2"
services:
traefik:
container_name: traefik
image: traefik:2.10.7
command:
- "--accesslog=true"
- "--api.insecure=true"
- "--entryPoints.metrics.address=:8082"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--global.sendAnonymousUsage"
- "--log.level=INFO"
- "--metrics.prometheus=true"
- "--metrics.prometheus.addrouterslabels=true"
- "--metrics.prometheus.entryPoint=metrics"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker=true"
# NOTE : le support du tracing avec otlp sera dans Traefik v3
# https://github.com/traefik/traefik/issues/6374#issuecomment-1329393583
# https://traefik.io/blog/traefik-proxy-3-0-scope-beta-program-and-the-first-feature-drop/#traefik-proxy-30-beta-1-and-the-first-feature-drop
# - "--tracing=true"
# - "--tracing.jaeger=true"
# - "--tracing.jaeger.samplingServerURL=http://localhost:5778/sampling"
ports:
- 80:80
- 8080:8080
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
jspring:
container_name: jspring
build: ./jspring
environment:
- OTEL_TRACES_EXPORTER=otlp
- OTEL_METRICS_EXPORTER=none
- OTEL_LOGS_EXPORTER=none
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
- OTEL_SERVICE_NAME=jspring
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/jspring
- SPRING_DATASOURCE_USERNAME=jspring
- SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD}
# - LOGGING_LEVEL_ROOT=DEBUG
labels:
- traefik.enable=true
- traefik.http.routers.jspring.entrypoints=web
- traefik.http.routers.jspring.rule=Host(`jspring.localhost`)
depends_on:
- postgres
postgres:
container_name: postgres
image: postgres:15-alpine
environment:
- POSTGRES_DB=jspring
- POSTGRES_USER=jspring
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
postgres-exporter:
container_name: postgres-exporter
image: prometheuscommunity/postgres-exporter:v0.12.0
environment:
DATA_SOURCE_NAME: "postgresql://jspring:${POSTGRES_PASSWORD}@postgres:5432/jspring?sslmode=disable"
depends_on:
- postgres
otel-collector:
container_name: otel
image: otel/opentelemetry-collector:0.76.1
command: [ "--config=/etc/otel-collector.yml" ]
volumes:
- ./otel-collector.yml:/etc/otel-collector.yml:ro
depends_on:
- tempo
- postgres-exporter
- prometheus
tempo:
container_name: tempo
image: grafana/tempo:1.5.0
command: [ "-config.file=/etc/tempo.yml" ]
volumes:
- ./tempo.yml:/etc/tempo.yml:ro
prometheus:
container_name: prometheus
image: prom/prometheus:v2.43.1
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--web.enable-remote-write-receiver"
labels:
- traefik.enable=true
- traefik.http.routers.prometheus.entrypoints=web
- traefik.http.routers.prometheus.rule=Host(`prometheus.localhost`)
grafana:
container_name: grafana
image: grafana/grafana:9.5.1
volumes:
- ./grafana-datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro
environment:
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
labels:
- traefik.enable=true
- traefik.http.routers.grafana.entrypoints=web
- traefik.http.routers.grafana.rule=Host(`grafana.localhost`)
depends_on:
- prometheus
- tempo