-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathdocker-compose-cloud.yml
118 lines (113 loc) · 3.41 KB
/
docker-compose-cloud.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
116
117
118
name: grafana-intro-to-mltp-cloud
volumes:
grafana:
postgres:
services:
# Grafana Alloy batches and processes traces sent to it, generating
# auto-logs from those traces.
# Includes Metrics, Logs, Traces and Profiles.
alloy:
image: grafana/alloy:v1.3.1
ports:
- "12347:12345"
- "12348:12348"
- "6832:6832"
- "55679:55679"
volumes:
- "./alloy/config.alloy:/etc/alloy/config.alloy"
- "./alloy/endpoints-cloud.json:/etc/alloy/endpoints.json"
command: [
"run",
"--server.http.listen-addr=0.0.0.0:12345",
"--stability.level=public-preview",
"/etc/alloy/config.alloy",
]
# A RabbitMQ queue used to send message between the requester and the server microservices.
mythical-queue:
image: rabbitmq:management
restart: always
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: rabbitmq-diagnostics check_running
interval: 5s
timeout: 30s
retries: 10
# A postgres DB used to store data by the API server microservice.
mythical-database:
image: postgres:14.5
restart: always
environment:
POSTGRES_PASSWORD: "mythical"
volumes:
- "postgres:/var/lib/postgresql/data"
ports:
- "5432:5432"
# A microservice that makes requests to the API server microservice. Requests are also pushed onto the mythical-queue.
mythical-requester:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-requester
image: grafana/intro-to-mltp:mythical-beasts-requester-latest
restart: always
depends_on:
mythical-queue:
condition: service_healthy
mythical-server:
condition: service_started
ports:
- "4001:4001"
environment:
- NAMESPACE=production
- LOGS_TARGET=http://alloy:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=alloy
- TRACING_COLLECTOR_PORT=4317
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.4
# The API server microservice.
# It writes logs directly to the Loki service, exposes metrics for the Prometheus
# service and sends traces to the Grafana Alloy instance.
mythical-server:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-server
image: grafana/intro-to-mltp:mythical-beasts-server-latest
restart: always
ports:
- "4000:4000"
- "80:80"
depends_on:
- mythical-database
environment:
- NAMESPACE=production
- LOGS_TARGET=http://alloy:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=alloy
- TRACING_COLLECTOR_PORT=4317
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.5
# A microservice that consumes requests from the mythical-queue
mythical-recorder:
#build:
# context: ./source
# dockerfile: docker/Dockerfile
# args:
# SERVICE: mythical-beasts-recorder
image: grafana/intro-to-mltp:mythical-beasts-recorder-latest
restart: always
depends_on:
mythical-queue:
condition: service_healthy
ports:
- "4002:4002"
environment:
- NAMESPACE=production
- LOGS_TARGET=http://alloy:3100/loki/api/v1/push
- TRACING_COLLECTOR_HOST=alloy
- TRACING_COLLECTOR_PORT=4317
- OTEL_EXPORTER_OTLP_TRACES_INSECURE=true
- OTEL_RESOURCE_ATTRIBUTES=ip=1.2.3.5