forked from sgentile/nest-apollo-federation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
130 lines (128 loc) · 2.84 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
version: '3.8'
services:
version: '3'
services:
redis:
container_name: redis
image: redis
restart: unless-stopped
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
networks:
- federation
user_service:
container_name: user_service
restart: always
build:
context: ./user-service
ports:
- "4001:4001"
expose:
- "4001"
networks:
- federation
volumes:
- ./user-service:/home/node/app
- /home/node/app/node_modules
depends_on:
- redis
env_file:
- ./user-service/.env
command: npm run start
posts_service:
container_name: posts_service
restart: always
build:
context: ./posts-service
ports:
- "4000:4000"
expose:
- "4000"
networks:
- federation
volumes:
- ./posts-service:/home/node/app
- /home/node/app/node_modules
depends_on:
- redis
links:
- redis:redis
env_file:
- ./posts-service/.env
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
command: npm run start
gateway_service:
container_name: gateway_service
restart: always
build:
context: ./gateway-service
ports:
- 4002:4002
networks:
- federation
volumes:
- ./gateway-service:/home/node/app
- /home/node/app/node_modules
depends_on:
- posts_service
- user_service
env_file:
- ./gateway-service/.env
environment:
- USERS_SERVICE_URL=http://user_service:4001/graphql
- POSTS_SERVICE_URL=http://posts_service:4000/graphql
command: npm start
subscription_service:
container_name: subscription_service
restart: always
build:
context: ./subscription-service
ports:
- 5000:5000
networks:
- federation
volumes:
- ./subscription-service:/home/node/app
- /home/node/app/node_modules
depends_on:
- redis
- gateway_service
env_file:
- ./subscription-service/.env
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- GATEWAY_API_URL=http://gateway_service:4002/api
command: npm start
react_app:
container_name: react_app
restart: always
build:
context: ./react-app
volumes:
- ./react-app:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- redis
- gateway_service
- subscription_service
env_file:
- ./react-app/.env
environment:
- REACT_APP_GATEWAY_API_URL=http://gateway_service:4002
# - REACT_APP_SUBSCRIPTIONS_API_URL=ws://subscription_service:5000/graphql
ports:
- 3000:3000
networks:
- federation
stdin_open: true
command: npm start
networks:
federation:
name: federation
driver: bridge