-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
162 lines (155 loc) · 4.11 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
version: '3'
services:
mysql-db:
image: mysql:8
container_name: mysql-db-container
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- ./mysql-db/user.sql:/docker-entrypoint-initdb.d/user.sql
ports:
- 3306:3306
networks:
- microservice
redis-cache:
image: redis:alpine
container_name: redis-cache-container
command: redis-server --requirepass ${REDIS_PASSWORD}
ports:
- 6379:6379
networks:
- microservice
authentication-service:
build:
context: .
dockerfile: ./server/authentication-service/Dockerfile-dev
container_name: authentication-service-container
restart: always
depends_on:
- mysql-db
- redis-cache
- react-ui
environment:
- DB_HOST=mysql-db
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_SCHEMA=${DB_SCHEMA}
- ACTIVE_PROFILE=${ACTIVE_PROFILE}
- PORT=${AUTHENTICATION_SERVICE_PORT}
links:
- mysql-db:mysql
expose:
- ${AUTHENTICATION_SERVICE_PORT}
ports:
- ${AUTHENTICATION_SERVICE_PORT}:${AUTHENTICATION_SERVICE_PORT}
networks:
- microservice
common-data-service:
build:
context: .
dockerfile: ./server/common-data-service/Dockerfile-dev
container_name: common-data-service-container
restart: always
depends_on:
- mysql-db
- redis-cache
- react-ui
environment:
- DB_HOST=mysql-db
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_SCHEMA=${DB_SCHEMA}
- ACTIVE_PROFILE=${ACTIVE_PROFILE}
- PORT=${COMMON_DATA_SERVICE_PORT}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=redis-cache
- REDIS_PORT=${REDIS_PORT}
- REACT_CLIENT_URL=${REACT_CLIENT_URL}
links:
- mysql-db:mysql
expose:
- ${COMMON_DATA_SERVICE_PORT}
ports:
- ${COMMON_DATA_SERVICE_PORT}:${COMMON_DATA_SERVICE_PORT}
networks:
- microservice
search-suggestion-service:
build:
context: .
dockerfile: ./server/search-suggestion-service/Dockerfile-dev
container_name: search-suggestion-service-container
restart: always
depends_on:
- mysql-db
- redis-cache
- react-ui
- common-data-service
- authentication-service
- payment-service
environment:
- ACTIVE_PROFILE=${ACTIVE_PROFILE}
- PORT=${SEARCH_SUGGESTION_SERVICE_PORT}
- COMMON_DATA_SERVICE_URL=http://common-data-service:${COMMON_DATA_SERVICE_PORT}
expose:
- ${SEARCH_SUGGESTION_SERVICE_PORT}
ports:
- ${SEARCH_SUGGESTION_SERVICE_PORT}:${SEARCH_SUGGESTION_SERVICE_PORT}
networks:
- microservice
payment-service:
build:
context: .
dockerfile: ./server/payment-service/Dockerfile-dev
container_name: payment-service-container
restart: always
depends_on:
- mysql-db
- redis-cache
- react-ui
environment:
- DB_HOST=mysql-db
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_SCHEMA=${DB_SCHEMA}
- ACTIVE_PROFILE=${ACTIVE_PROFILE}
- PORT=${PAYMENT_SERVICE_PORT}
links:
- mysql-db:mysql
expose:
- ${PAYMENT_SERVICE_PORT}
ports:
- ${PAYMENT_SERVICE_PORT}:${PAYMENT_SERVICE_PORT}
networks:
- microservice
react-ui:
build:
context: .
dockerfile: ./client/Dockerfile
container_name: react-service-container
stdin_open: true
restart: always
expose:
- ${REACT_APP_PORT}
ports:
- ${REACT_APP_PORT}:${REACT_APP_PORT}
environment:
- REACT_APP_STRIPE_PUBLISH_KEY=${REACT_APP_STRIPE_PUBLISH_KEY}
- REACT_APP_COMMON_DATA_SERVICE_PORT=${COMMON_DATA_SERVICE_PORT}
- REACT_APP_ENVIRONMENT=${REACT_APP_ENVIRONMENT}
volumes:
- ./client:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- mysql-db
- redis-cache
networks:
- microservice
networks:
microservice:
external: true