-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
139 lines (129 loc) · 3.01 KB
/
docker-compose.yaml
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
version: '3.8'
services:
twote-web:
build:
context: .
dockerfile: twote-web/Dockerfile
ports:
- "3000:3000"
depends_on:
- envoy-proxy
envoy-proxy:
image: envoyproxy/envoy:v1.18.3
ports:
- "8080:8080"
volumes:
- ./envoy.yaml:/etc/envoy/envoy.yaml
depends_on:
- twote-api
twote-api:
build:
context: .
dockerfile: twote-api/Dockerfile
ports:
- "8081:8081"
depends_on:
profiles-backend:
condition: service_healthy
tweets-backend:
condition: service_healthy
accounts-backend:
condition: service_healthy
token-cache:
condition: service_healthy
volumes:
- ./schemas:/usr/src/schemas
accounts-backend:
build:
context: .
dockerfile: accounts-backend/Dockerfile
ports:
- "8082:8082"
volumes:
- ./schemas:/usr/src/schemas
environment:
DATABASE_URL: "postgres://myuser:mypassword@accounts-db/mydatabase"
depends_on:
accounts-db:
condition: service_healthy
token-cache:
condition: service_healthy
healthcheck:
test: [ "CMD", "grpc-health-probe", "-addr=localhost:8082" ]
interval: 300ms
timeout: 500ms
retries: 25
profiles-backend:
build:
context: .
dockerfile: profiles-backend/Dockerfile
ports:
- "8083:8083"
volumes:
- ./schemas:/usr/src/schemas
depends_on:
profiles-db:
condition: service_healthy
healthcheck:
test: [ "CMD", "grpc-health-probe", "-addr=localhost:8083" ]
interval: 300ms
timeout: 500ms
retries: 25
tweets-backend:
build:
context: .
dockerfile: tweets-backend/Dockerfile
ports:
- "8084:8084"
depends_on:
tweets-db:
condition: service_healthy
healthcheck:
test: [ "CMD", "grpc-health-probe", "-addr=localhost:8084" ]
interval: 300ms
timeout: 500ms
retries: 25
accounts-db:
image: postgres:16
environment:
POSTGRES_DB: mydatabase
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -h localhost -p 5432 -U myuser -d mydatabase" ]
interval: 300ms
timeout: 500ms
retries: 25
token-cache:
image: redis:latest
ports:
- "6379:6379"
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
interval: 300ms
timeout: 500ms
retries: 25
tweets-db:
image: mongo:latest
command: --quiet
ports:
- "27018:27017"
healthcheck:
test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')" ]
interval: 500ms
timeout: 500ms
retries: 25
start_period: 40s
profiles-db:
image: mongo:latest
command: --quiet
ports:
- "27017:27017"
healthcheck:
test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')" ]
interval: 500ms
timeout: 500ms
retries: 25
start_period: 40s