-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
186 lines (179 loc) · 5.3 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
services:
nginx:
image: nginx:latest
ports: [80:80, 443:443]
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- identity-service
- file-storage-service
- user-service
restart: on-failure
# Identity service
identity-service:
build: ./identity-service
volumes:
- ./identity-service/config.yml:/app/config.yml:ro
- ./keys:/app/keys:ro
depends_on:
- identity-redis
restart: on-failure
identity-redis:
image: redis:latest
volumes:
- identity_redis_data:/data
environment:
- REDIS_PASSWORD=secret
restart: on-failure
# File storage service
file-storage-service:
build: ./file-storage-service
volumes:
- ./file-storage-service/config.yml:/app/config.yml:ro
- ./keys/rsa.pub:/app/keys/rsa.pub:ro
environment:
FILE_STORAGE_AWS_ACCESS_KEY_ID: ${FILE_STORAGE_AWS_ACCESS_KEY_ID}
FILE_STORAGE_AWS_REGION: ${FILE_STORAGE_AWS_REGION}
FILE_STORAGE_AWS_ENDPOINT_URL: ${FILE_STORAGE_AWS_ENDPOINT_URL}
FILE_STORAGE_AWS_SECRET_ACCESS_KEY: ${FILE_STORAGE_AWS_SECRET_ACCESS_KEY}
FILE_STORAGE_S3_BUCKET: ${FILE_STORAGE_S3_BUCKET}
FILE_STORAGE_S3_URL_PREFIX: ${FILE_STORAGE_S3_URL_PREFIX}
FILE_STORAGE_DB_DSN: host=file-storage-postgres port=5432 user=postgres password=secret dbname=file_metadata sslmode=disable
depends_on:
- file-storage-redis
- file-storage-postgres
restart: on-failure
file-storage-postgres:
image: postgres:latest
ports: ["5434:5432"]
volumes:
- file_storage_postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=secret
- POSTGRES_USER=postgres
- POSTGRES_DB=file_metadata
restart: on-failure
file-storage-redis:
image: redis:latest
volumes:
- file_storage_redis_data:/data
environment:
- REDIS_PASSWORD=secret
restart: on-failure
file-storage-minio:
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
volumes:
- file_storage_minio_data:/data
# - ./minio-certs:/root/.minio/certs
environment:
- MINIO_ROOT_USER=chakchat-admin
- MINIO_ROOT_PASSWORD=secret12345
command: ["server", "/data", "--address", ":9000", "--console-address", ":9001"]
restart: on-failure
# User service
user-service:
build:
context: user-service
dockerfile: Dockerfile
environment:
- DB_DSN=postgres://user:secret@user-postgres:5432/userdb?sslmode=disable
depends_on:
- user-postgres
volumes:
- ./user-service/config.yml:/app/config.yml
- ./keys/rsa.pub:/app/keys/rsa.pub:ro
restart: on-failure
user-postgres:
image: postgres:latest
ports: ["5433:5432"]
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: secret
POSTGRES_DB: userdb
restart: on-failure
volumes:
- user_postgres_data:/var/lib/postgresql/data
user-flyway:
image: flyway/flyway:latest
command: ["migrate"]
environment:
- FLYWAY_URL=jdbc:postgresql://user-postgres:5432/userdb
- FLYWAY_USER=user
- FLYWAY_PASSWORD=secret
- FLYWAY_LOCATIONS=filesystem:/app/migrations
- FLYWAY_VALIDATE_MIGRATION_NAMING=true
- FLYWAY_BASELINE_ON_MIGRATE=true
volumes:
- ./user-service/migrations:/app/migrations
restart: on-failure
messaging-service:
build: ./messaging-service
volumes:
- ./messaging-service/config.yml:/app/config.yml:ro
- ./keys/rsa.pub:/app/keys/rsa.pub:ro
depends_on:
- messaging-redis
- messaging-postgres
environment:
- DB_CONN_STRING=postgres://postgres:secret@messaging-postgres:5432/messaging?sslmode=disable
restart: on-failure
messaging-redis:
image: redis:latest
volumes:
- messaging_redis_data:/data
environment:
- REDIS_PASSWORD=secret
restart: on-failure
messaging-postgres:
image: postgres:latest
volumes:
- messaging_postgres_data:/var/lib/postgresql/data
ports: ["5432:5432"]
environment:
- POSTGRES_PASSWORD=secret
- POSTGRES_USER=postgres
- POSTGRES_DB=messaging
restart: on-failure
messaging-flyway:
image: flyway/flyway:latest
command: ["migrate"]
environment:
- FLYWAY_URL=jdbc:postgresql://messaging-postgres:5432/messaging
- FLYWAY_USER=postgres
- FLYWAY_PASSWORD=secret
- FLYWAY_LOCATIONS=filesystem:/app/migrations
- FLYWAY_VALIDATE_MIGRATION_NAMING=true
- FLYWAY_BASELINE_ON_MIGRATE=true
volumes:
- ./messaging-service/migrations:/app/migrations
restart: on-failure
# Stubs
sms-service-stub:
build:
context: stubs/sms-service-stub
restart: on-failure
# Observability
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
restart: on-failure
jaeger:
image: jaegertracing/all-in-one:latest
ports: [16686:16686]
environment:
COLLECTOR_OTLP_ENABLED: "true"
restart: on-failure
volumes:
file_storage_redis_data:
file_storage_postgres_data:
file_storage_minio_data:
identity_redis_data:
user_postgres_data:
messaging_redis_data:
messaging_postgres_data: