-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (82 loc) · 2.61 KB
/
docker-compose.yml
File metadata and controls
87 lines (82 loc) · 2.61 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
79
80
81
82
83
84
85
86
87
services:
traefik:
image: traefik:v3.6.8
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--tracing.serviceName=todo-traefik"
- "--tracing.otlp=true"
- "--tracing.otlp.http=true"
- "--tracing.otlp.http.endpoint=http://otel-collector:4318/v1/traces"
- "--metrics.otlp=true"
- "--metrics.otlp.http=true"
- "--metrics.otlp.http.endpoint=http://otel-collector:4318/v1/metrics"
- "--accesslog=true"
- "--accesslog.otlp=true"
- "--accesslog.otlp.http=true"
- "--accesslog.otlp.http.endpoint=http://otel-collector:4318/v1/logs"
- "--experimental.otlpLogs=true"
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- otel-collector
frontend:
build: ./frontend
environment:
BACKEND_URL: http://traefik/api
OTEL_SERVICE_NAME: todo-frontend
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_TRACES_EXPORTER: otlp
OTEL_METRICS_EXPORTER: otlp
OTEL_LOGS_EXPORTER: otlp
NEXT_RUNTIME: nodejs
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=PathPrefix(`/`)"
- "traefik.http.routers.frontend.entrypoints=web"
- "traefik.http.routers.frontend.priority=1"
- "traefik.http.services.frontend.loadbalancer.server.port=3000"
depends_on:
- backend
- otel-collector
backend:
build: ./backend
environment:
REDIS_URL: redis://redis:6379
BASE_PATH: /api
OTEL_SERVICE_NAME: todo-backend
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
OTEL_TRACES_EXPORTER: otlp
OTEL_METRICS_EXPORTER: otlp
OTEL_LOGS_EXPORTER: otlp
LOG_LEVEL: info
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=PathPrefix(`/api`)"
- "traefik.http.routers.backend.entrypoints=web"
- "traefik.http.routers.backend.priority=10"
- "traefik.http.services.backend.loadbalancer.server.port=4000"
depends_on:
- redis
- otel-collector
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- redis-data:/data
otel-collector:
image: otel/opentelemetry-collector-contrib:0.143.0
ports:
- "4317:4317"
- "4318:4318"
volumes:
- ./otel/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml:ro
volumes:
redis-data: