-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
97 lines (88 loc) · 2.48 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
version: '3.7'
services:
customer_service:
build: ./customer-service
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
volumes:
- ./customer-service/:/app/
ports:
- 8001:8000
environment:
- DATABASE_URI=postgresql://customer_db_username:customer_db_password@customer_db/customer_db_dev
depends_on:
- customer_db
customer_db:
image: postgres:latest
volumes:
- postgres_data_customer:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=customer_db_username
- POSTGRES_PASSWORD=customer_db_password
- POSTGRES_DB=customer_db_dev
logging:
driver: none
product_service:
build: ./product-service
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
volumes:
- ./product-service/:/app/
ports:
- 8002:8000
environment:
- DATABASE_URI=postgresql://product_db_username:product_db_password@product_db/product_db_dev
logging:
driver: none
product_db:
image: postgres:latest
volumes:
- postgres_data_product:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=product_db_username
- POSTGRES_PASSWORD=product_db_password
- POSTGRES_DB=product_db_dev
logging:
driver: none
price_service:
build: ./price-service
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
volumes:
- ./price-service/:/app/
ports:
- 8003:8000
environment:
- DATABASE_URI=postgresql://price_db_username:price_db_password@price_db/price_db_dev
order_service:
build: ./order-service
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
volumes:
- ./order-service/:/app/
ports:
- 8004:8000
environment:
- DATABASE_URI=postgresql://order_db_username:order_db_password@order_db/order_db_dev
order_db:
image: postgres:latest
volumes:
- postgres_data_order:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=order_db_username
- POSTGRES_PASSWORD=order_db_password
- POSTGRES_DB=order_db_dev
logging:
driver: none
nginx:
image: nginx:latest
ports:
- "8080:8080"
volumes:
- ./nginx_config.conf:/etc/nginx/conf.d/default.conf
depends_on:
- customer_service
- product_service
- price_service
- order_service
volumes:
postgres_data_customer:
postgres_data_product:
postgres_data_price:
postgres_data_order: