-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
188 lines (182 loc) · 4.17 KB
/
compose.yaml
File metadata and controls
188 lines (182 loc) · 4.17 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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
services:
knight:
build:
context: ./.
dockerfile: ./docker/Dockerfile.knight
container_name: knight
depends_on:
mongo:
condition: service_healthy
consul:
condition: service_healthy
grafana:
condition: service_started
promtail:
condition: service_started
loki:
condition: service_started
environment:
- DB_URL=mongodb://admin:admin11@mongo/knight?authSource=admin
- ENV=prod
- PORT=4000
- LOG_LEVEL=info
- REGISTRY_URI=consul:8500
labels:
logging: "promtail"
logging_jobname: "containerlogs"
ports:
- 4000:4000
networks:
- app
quest:
build:
context: ./.
dockerfile: ./docker/Dockerfile.quest
container_name: quest
restart: always
depends_on:
knight:
condition: service_started
postgres:
condition: service_started
consul:
condition: service_healthy
grafana:
condition: service_started
promtail:
condition: service_started
loki:
condition: service_started
environment:
- DB_URL=postgres://user:password@postgres/quest?sslmode=disable
- ENV=dev
- PORT=4000
- LOG_LEVEL=info
- REGISTRY_URI=consul:8500
labels:
logging: "promtail"
logging_jobname: "containerlogs"
networks:
- app
postgres:
image: postgres:14-alpine
# ports:
# - 5432:5432
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=user
- POSTGRES_DB=quest
networks:
- app
migrate:
image: migrate/migrate
volumes:
- ./db/migrations:/migrations
command:
[
"-path",
"/migrations",
"-database",
"postgres://user:password@postgres:5432/quest?sslmode=disable",
"up",
]
networks:
- app
labels:
logging: "promtail"
logging_jobname: "containerlogs"
links:
- postgres
mongo:
image: "mongo:7.0.5"
ports:
- 27017:27017
environment:
- MONGO_INITDB_DATABASE=knight
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=admin11
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
logging:
driver: none
networks:
- app
loki:
image: grafana/loki:2.9.2
container_name: loki
ports:
- 3100:3100
command: -config.file=/etc/loki/local-config.yaml
networks:
- app
promtail:
image: grafana/promtail:2.9.2
container_name: promtail
volumes:
- ./configs/promtail.yaml:/etc/promtail/docker-config.yaml
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock
command: -config.file=/etc/promtail/docker-config.yaml
depends_on:
- loki
- grafana
networks:
- app
grafana:
image: grafana/grafana:10.4.2
volumes:
- ./configs/grafana.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
ports:
- "3000:3000"
networks:
- app
consul:
image: hashicorp/consul:1.11.2
ports:
- 8500:8500
networks:
- app
healthcheck:
test: ["CMD", "curl", "-X", "GET", "localhost:8500/v1/status/leader"]
interval: 1s
timeout: 3s
retries: 60
gateway:
build:
context: ./.
dockerfile: ./docker/Dockerfile.httpgrpc
container_name: gateway
ports:
- 8080:8080
restart: always
depends_on:
knight:
condition: service_started
grafana:
condition: service_started
promtail:
condition: service_started
loki:
condition: service_started
environment:
- ENV=prod
- PORT=8080
- LOG_LEVEL=info
- REGISTRY_URI=consul:8500
labels:
logging: "promtail"
logging_jobname: "containerlogs"
networks:
- app
networks:
app:
name: app