-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
116 lines (107 loc) · 2.16 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
version: '3.8'
services:
postgres:
image: postgres:13
container_name: microservices-postgres
environment:
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
ports:
- "5432:5432"
networks:
- backend
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
user:
image: user-service-app
container_name: user-service-app
ports:
- "${PORT_USER}:${PORT_USER}"
- "9004:9004"
networks:
- backend
env_file:
- .env
build:
context: ./user
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- postgres
product:
image: product-service-app
container_name: product-service-app
ports:
- "${PORT_PRODUCT}:${PORT_PRODUCT}"
networks:
- backend
env_file:
- .env
build:
context: ./product
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- postgres
- user
order:
image: order-service-app
container_name: order-service-app
ports:
- "${PORT_ORDER}:${PORT_ORDER}"
networks:
- backend
env_file:
- .env
build:
context: ./order
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- postgres
- user
- product
payment:
image: payment-service-app
container_name: payment-service-app
ports:
- "${PORT_PAYMENT}:${PORT_PAYMENT}"
networks:
- backend
env_file:
- .env
build:
context: ./payment
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- postgres
- user
- product
- order
api-gateway:
image: api-gateway-service-app
container_name: api_gateway-service-app
ports:
- "${PORT_API_GATEWAY}:${PORT_API_GATEWAY}"
networks:
- backend
env_file:
- .env
build:
context: ./api-gateway
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- postgres
- user
- product
- order
- payment
networks:
backend:
driver: bridge
volumes:
postgres-data: