forked from aws-samples/retail-demo-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
252 lines (238 loc) · 5.13 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# Docker compose file for local development.
# Initialize your local environment variables either in your shell
# or in the ".env" file.
version: "3.7"
services:
carts:
container_name: carts
depends_on:
- ddb
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- AWS_REGION
- DDB_TABLE_CARTS
- DDB_ENDPOINT_OVERRIDE
build:
context: ./carts
networks:
- dev-net
ports:
- "8003:80"
ddb:
image: amazon/dynamodb-local
container_name: ddb
command: -jar DynamoDBLocal.jar -port 3001
networks:
- dev-net
ports:
- 3001:3001
orders:
container_name: orders
depends_on:
- ddb
environment:
- AWS_REGION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- DDB_TABLE_ORDERS
- DDB_ENDPOINT_OVERRIDE
build:
context: ./orders
networks:
- dev-net
ports:
- "8004:80"
products:
container_name: products
depends_on:
- ddb
environment:
- AWS_PROFILE
- AWS_DEFAULT_REGION
- DDB_TABLE_PRODUCTS
- DDB_TABLE_CATEGORIES
- DDB_TABLE_PERSONALISED_PRODUCTS
- CACHE_PERSONALISED_PRODUCTS
- DDB_ENDPOINT_OVERRIDE
- IMAGE_ROOT_URL
- WEB_ROOT_URL
- FLASK_CONFIG
- COGNITO_USER_POOL_ID
- COGNITO_USER_POOL_CLIENT_ID
- VERIFY_IDENTITY_TOKEN
volumes:
- ~/.aws/:/root/.aws:ro
build:
context: ./products
networks:
- dev-net
ports:
- "8001:80"
recommendations:
container_name: recommendations
depends_on:
- products
environment:
- AWS_PROFILE
- AWS_DEFAULT_REGION
- PRODUCT_SERVICE_HOST
- PRODUCT_SERVICE_PORT
- OFFERS_SERVICE_HOST
- OFFERS_SERVICE_PORT
- AWS_XRAY_DAEMON_ADDRESS=xray:2000
- EVIDENTLY_PROJECT_NAME
volumes:
- ~/.aws/:/root/.aws:ro
build:
context: ./recommendations
networks:
- dev-net
ports:
- "8005:80"
# OpenSearch required for search service
opensearch:
image: opensearchproject/opensearch:1.3.3
container_name: opensearch
environment:
- plugins.security.disabled=true
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
volumes:
- ${APPDATA}/opensearch/data:/tmp/opensearch/data
networks:
- dev-net
ports:
- 9200:9200
- 9300:9300
search:
container_name: search
depends_on:
- opensearch
environment:
- AWS_PROFILE
- OPENSEARCH_DOMAIN_SCHEME
- OPENSEARCH_DOMAIN_HOST
- OPENSEARCH_DOMAIN_PORT
volumes:
- ~/.aws/:/root/.aws:ro
build:
context: ./search
networks:
- dev-net
ports:
- "8006:80"
users:
container_name: users
environment:
- AWS_REGION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
build:
context: ./users
networks:
- dev-net
ports:
- "8002:80"
offers:
container_name: offers
build:
context: offers
networks:
- dev-net
ports:
- "8008:80"
location:
container_name: location
build:
context: location
networks:
- dev-net
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- RESOURCE_BUCKET
- AWS_PROFILE
- AWS_DEFAULT_REGION
volumes:
- ~/.aws/:/root/.aws:ro
ports:
- "8009:80"
# This service has it's own .env file at src/web-ui/.env
web-ui:
container_name: web-ui
build:
context: ./web-ui
target: production-stage
networks:
- dev-net
ports:
- "8080:80"
volumes:
- ../images:/usr/share/nginx/html/images:ro
videos:
container_name: videos
build:
context: ./videos
networks:
- dev-net
environment:
- AWS_PROFILE
- AWS_DEFAULT_REGION
- RESOURCE_BUCKET
- PARAMETER_IVS_VIDEO_CHANNEL_MAP
- USE_DEFAULT_IVS_STREAMS
- AWS_XRAY_DAEMON_ADDRESS=xray:2000
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- IMAGE_ROOT_URL
volumes:
- ~/.aws/:/root/.aws:ro
ports:
- "8007:80"
xray:
image: amazon/aws-xray-daemon
ports:
- 2000:2000/udp
environment:
- AWS_PROFILE
- AWS_DEFAULT_REGION
- AWS_REGION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- HOME=/home
networks:
- dev-net
volumes:
- ~/.aws/:/home/.aws:ro
swagger-ui:
container_name: swagger-ui
build:
# This has to be outside of folder swagger-ui because it must copy
# open api spec files from all services
context: ./
dockerfile: swagger-ui/Dockerfile
volumes:
- ${PWD}/swagger-ui/index.html:/usr/share/nginx/html/index.html
- ${PWD}/swagger-ui/services.json:/usr/share/nginx/html/services.json
networks:
- dev-net
ports:
- "8081:80"
networks:
dev-net:
driver: bridge