-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
167 lines (153 loc) · 4.22 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
version: "3"
services:
client:
build:
context: ./
dockerfile: ./docker/client/Dockerfile
image: morais/farmers-market-client:latest
environment:
MARKET_SERVICE_HOST: http://market-api:${MARKET_GATEWAY_PORT}
depends_on:
- market-api
- products-seed
- specials-seed
market-api:
build:
context: ./
dockerfile: ./docker/gateway/Dockerfile
image: morais/farmers-market-api:latest
environment:
MARKET_GATEWAY_PORT: "${MARKET_GATEWAY_PORT}"
CART_SERVICE_HOST: http://carts:${MARKET_CARTS_PORT}
PRODUCT_SERVICE_HOST: http://products:${MARKET_PRODUCTS_PORT}
CASHIER_SERVICE_HOST: http://cashier:${MARKET_CASHIER_PORT}
depends_on:
- products
- carts
- cashier
products:
build:
context: ./
dockerfile: ./docker/products/Dockerfile
image: morais/farmers-market-products:latest
environment:
MARKET_PRODUCTS_PORT: ${MARKET_PRODUCTS_PORT}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
PRODUCT_DB_HOST: productdb
depends_on:
- productdb
products-seed:
image: "morais/farmers-market-products:latest"
command: ["python", "seed.py"]
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
PRODUCT_DB_HOST: productdb
depends_on:
- productdb
productdb:
image: "mysql:5.7"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: "market"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-ppassword", "--silent"]
interval: 5s
ports:
- 3306:3306
volumes:
- db-data:/data/db
carts:
build:
context: ./
dockerfile: ./docker/carts/Dockerfile
image: morais/farmers-market-carts:latest
environment:
MARKET_CARTS_PORT: "${MARKET_CARTS_PORT}"
CART_STORE_HOST: cart-store
depends_on:
- cart-store
cashier:
build:
context: ./
dockerfile: ./docker/cashier/Dockerfile
image: morais/farmers-market-cashier:latest
environment:
DOC_STORE_HOST: doc-store
PRODUCT_SERVICE_HOST: http://products:${MARKET_PRODUCTS_PORT}
MARKET_CASHIER_PORT: "${MARKET_CASHIER_PORT}"
depends_on:
- doc-store
- products
specials-seed:
image: "morais/farmers-market-cashier:latest"
command: ["python", "seed.py"]
environment:
DOC_STORE_HOST: doc-store
depends_on:
- doc-store
doc-store:
image: mongo:latest
environment:
MONGODB_USER: ${MONGODB_USER}
MONGODB_DATABASE: market
MONGODB_PASS: ${MONGODB_PASS}
MONGO_DATA_DIR: /data/db
MONGO_LOG_DIR: /dev/null
volumes:
- doc-data:/data/db
ports:
- 32001:27017
cashier-tests:
image: "morais/farmers-market-cashier:latest"
command: ["python", "-m", "pytest"]
environment:
DOC_STORE_HOST: doc-store
PRODUCT_SERVICE_HOST: http://products:${MARKET_PRODUCTS_PORT}
depends_on:
- products-seed
- specials-seed
- doc-store
- products
client-tests:
image: "morais/farmers-market-client:latest"
command: ["python", "-m", "pytest"]
environment:
MARKET_SERVICE_HOST: http://market-api:${MARKET_GATEWAY_PORT}
depends_on:
- market-api
- products-seed
- specials-seed
carts-tests:
image: "morais/farmers-market-carts:latest"
command: ["python", "-m", "pytest"]
environment:
MARKET_CARTS_PORT: ${MARKET_CARTS_PORT}
CART_STORE_HOST: cart-store
depends_on:
- cart-store
cart-store:
image: "redis:alpine"
market-api-tests:
image: "morais/farmers-market-api:latest"
command: ["python", "-m", "pytest"]
environment:
CART_SERVICE_HOST: http://carts:${MARKET_CARTS_PORT}
PRODUCT_SERVICE_HOST: http://products:${MARKET_PRODUCTS_PORT}
CASHIER_SERVICE_HOST: http://cashier:${MARKET_CASHIER_PORT}
depends_on:
- products
- products-seed
- carts
- cashier
- specials-seed
products-tests:
image: "morais/farmers-market-products:latest"
command: ["python", "-m", "pytest"]
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
PRODUCT_DB_HOST: productdb
depends_on:
- productdb
volumes:
db-data:
doc-data: