-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
105 lines (99 loc) · 2.35 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
version: "3.8"
services:
client:
image: client:dev_v1
build:
context: ./front-end
dockerfile: Dockerfile
ports:
- "8900:80"
restart: always
depends_on:
- product-service
- user-service
- cart-service
networks:
- app-network
user-service:
image: user-service:dev_v1
build:
context: ./User
dockerfile: Dockerfile
container_name: user-service
environment:
- PORT_USER_SERVICE=${PORT_USER_SERVICE}
- ACCESS_TOKEN=${ACCESS_TOKEN}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
# - MONGO_USERNAME=${MONGO_USERNAME}
# - MONGO_PASSWORD=${MONGO_PASSWORD}
# - MONGO_CLUSTER=${MONGO_CLUSTER}
restart: always
ports:
- "${PORT_USER_SERVICE}:${PORT_USER_SERVICE}"
depends_on:
- db
networks:
- db-network
- app-network
cart-service:
image: cart-service:dev_v1
build:
context: ./Cart
dockerfile: Dockerfile
restart: always
container_name: cart-service
environment:
- PORT_CART_SERVICE=${PORT_CART_SERVICE}
- ACCESS_TOKEN=${ACCESS_TOKEN}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
# - MONGO_USERNAME=${MONGO_USERNAME}
# - MONGO_PASSWORD=${MONGO_PASSWORD}
# - MONGO_CLUSTER=${MONGO_CLUSTER}
ports:
- "${PORT_CART_SERVICE}:${PORT_CART_SERVICE}"
depends_on:
- db
networks:
- db-network
- app-network
product-service:
image: product-service:dev_v1
build:
context: ./Product
dockerfile: Dockerfile
restart: always
container_name: product-service
environment:
- PORT_PRODUCT_SERVICE=${PORT_PRODUCT_SERVICE}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
# - MONGO_USERNAME=${MONGO_USERNAME}
# - MONGO_PASSWORD=${MONGO_PASSWORD}
# - MONGO_CLUSTER=${MONGO_CLUSTER}
ports:
- "${PORT_PRODUCT_SERVICE}:${PORT_PRODUCT_SERVICE}"
depends_on:
- db
networks:
- db-network
- app-network
db:
image: mongo:4.4
volumes:
- ./.docker/data/db:/data/db
restart: unless-stopped
networks:
- db-network
user: "1001:1001"
networks:
db-network:
driver: bridge
name: db-network
app-network:
driver: bridge
name: app-network