-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
200 lines (190 loc) · 5.9 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
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
189
190
191
192
193
194
195
196
197
198
199
200
version: "3.9"
services:
api:
profiles: [ "api" ]
container_name: decision_making_app.api
build:
context: .
restart: unless-stopped
expose:
- "5000"
ports:
- "5000:5000"
depends_on:
minio:
condition: service_healthy
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- decision_making_app.minio.network
- decision_making_app.postgres.network
- decision_making_app.rabbitmq.network
volumes:
- ./config:/decision_making_app/config:ro
environment:
CONFIG_PATH: ${CONFIG_PATH:-./config/local.ini}
command: [ "python", "-Om", "dma" ]
healthcheck:
test: [ "CMD-SHELL", "curl -fsSL http://localhost:5000/healthcheck/" ]
interval: 10s
timeout: 60s
retries: 5
start_period: 10s
postgres:
profiles: [ "api", "migration" ]
container_name: decision_making_app.postgres
hostname: decision_making_app.postgres
image: "postgres:15-alpine"
restart: unless-stopped
expose:
- "5432"
ports:
- "127.0.0.1:15432:5432"
networks:
- decision_making_app.postgres.network
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-decision_making_app_admin}
POSTGRES_USER: ${POSTGRES_USER:-decision_making_app_admin}
POSTGRES_DB: ${POSTGRES_DB:-decision_making_app}
volumes:
- decision_making_app.postgres.data:/var/lib/postgresql/data:rw
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER" ]
interval: 10s
timeout: 60s
retries: 5
start_period: 10s
postgres_migration:
profiles: [ "migration" ]
container_name: decision_making_app.postgres_migration
build:
context: .
restart: on-failure
depends_on:
postgres:
condition: service_healthy
networks:
- decision_making_app.postgres.network
volumes:
- ./config:/decision_making_app/config:ro
- ./alembic.ini:/decision_making_app/alembic.ini:ro
- ./src/dma/infrastructure/database/migrations:/decision_making_app/src/dma/infrastructure/database/migrations:ro
environment:
CONFIG_PATH: ${CONFIG_PATH:-./config/local.ini}
command: [ "python", "-Om", "alembic", "upgrade", "head" ]
minio:
profiles: [ "api" ]
container_name: decision_making_app.minio
image: "quay.io/minio/minio"
command: [ "server", "--address", ":9000", "--console-address", ":9001", "/data" ]
ports:
- "9000:9000"
- "9001:9001"
networks:
- decision_making_app.minio.network
volumes:
- decision_making_app.minio.data:/data:rw
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-decision_making_app_admin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-decision_making_app_admin}
healthcheck:
test: [ "CMD", "mc", "ready", "local" ]
interval: 5s
timeout: 5s
retries: 5
# test: [ "CMD-SHELL", "curl -I http://localhost:9000/minio/health/live" ]
# interval: 10s
# timeout: 60s
# retries: 5
# start_period: 10s
rabbitmq:
profiles: [ "api" ]
image: rabbitmq:3.11-management-alpine
container_name: decision_making_app.rabbitmq
hostname: decision_making_app.rabbitmq
restart: unless-stopped
expose:
- "5672" # AMQP port
- "15672" # HTTP management UI dashboard port
ports:
- "127.0.0.1:5672:5672"
- "127.0.0.1:15672:15672"
networks:
- decision_making_app.rabbitmq.network
volumes:
- decision_making_app.rabbitmq.data:/var/lib/rabbitmq/:rw
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-decision_making_app_admin}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-decision_making_app_admin}
healthcheck:
test: [ "CMD-SHELL", "rabbitmq-diagnostics check_running -q" ]
interval: 10s
timeout: 60s
retries: 5
start_period: 10s
grafana:
profiles: [ "grafana" ]
image: grafana/grafana:9.5.2
container_name: decision_making_app.grafana
hostname: decision_making_app.grafana
restart: unless-stopped
expose:
- "3000"
ports:
- "127.0.0.1:3000:3000"
networks:
- decision_making_app.grafana.network
volumes:
- decision_making_app.grafana.data:/var/lib/grafana:rw
- ./grafana/provisioning:/etc/grafana/provisioning:rw
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-decision_making_app_admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-decision_making_app_admin}
- GF_USERS_ALLOW_SIGN_UP=false
- VIRTUAL_HOST=decision_making_app.grafana
- NETWORK_ACCESS=internal
- VIRTUAL_PORT=3000
loki:
profiles: [ "grafana" ]
image: grafana/loki:2.8.2
container_name: decision_making_app.loki
hostname: decision_making_app.loki
expose:
- "3100"
volumes:
- ./loki/config.yaml:/etc/loki/config.yaml:ro
- decision_making_app.loki.data:/tmp/:rw
command: -config.file=/etc/loki/config.yaml
restart: unless-stopped
networks:
- decision_making_app.grafana.network
vector:
profiles: [ "grafana" ]
image: timberio/vector:0.29.1-alpine
container_name: decision_making_app.vector
hostname: decision_making_app.vector
depends_on:
loki:
condition: service_started
command: --config /etc/vector/vector.toml
restart: unless-stopped
expose:
- "8383"
networks:
- decision_making_app.grafana.network
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./vector/vector.toml:/etc/vector/vector.toml:ro
volumes:
decision_making_app.minio.data:
decision_making_app.postgres.data:
decision_making_app.rabbitmq.data:
decision_making_app.grafana.data:
decision_making_app.loki.data:
networks:
decision_making_app.minio.network:
decision_making_app.postgres.network:
decision_making_app.rabbitmq.network:
decision_making_app.grafana.network: