-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
175 lines (159 loc) · 3.76 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
163
164
165
166
167
168
169
170
171
172
173
174
175
version: "3"
services:
frontend:
container_name: frontend
restart: unless-stopped
build:
context: ./frontend
dockerfile: Dockerfile # 배포때는 dockerfile: dockerfile.prod
ports:
- 3000:3000
volumes:
- ./frontend/:/frontend
- /frontend/node_modules #배포때는 ./frontend/node_modules:/frontend/node_modules
environment:
- CI=true
- CHOKIDAR_USEPOLLING=true
- REACT_APP_BACKEND_URL=http://localhost
stdin_open: true
tty: true
networks:
- aiary
backend:
container_name: backend
build:
context: ./backend-spring
dockerfile: Dockerfile
network_mode: "service:node1"
restart: always
networks:
- aiary
node1:
container_name: node1
image: redis
volumes:
- ./redis/redis1.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- 7001:7001
- 7002:7002
- 7003:7003
- 7004:7004
- 7005:7005
- 7006:7006
- 8080:8080
networks:
- aiary
node2:
network_mode: "service:node1"
container_name: node2
image: redis
volumes:
- ./redis/redis2.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
node3:
network_mode: "service:node1"
container_name: node3
image: redis
volumes:
- ./redis/redis3.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
node4:
network_mode: "service:node1"
container_name: node4
image: redis
volumes:
- ./redis/redis4.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
node5:
network_mode: "service:node1"
container_name: node5
image: redis
volumes:
- ./redis/redis5.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
node6:
network_mode: "service:node1"
container_name: node6
image: redis
volumes:
- ./redis/redis6.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
redis-cluster-entry:
network_mode: "service:node1"
image: redis
container_name: redis-cluster
command: redis-cli --cluster create 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006 --cluster-replicas 1 --cluster-yes
depends_on:
- node1
- node2
- node3
- node4
- node5
- node6
ai_backend:
container_name: ai_backend
build:
context: ./Ai-flask
dockerfile: Dockerfile
environment:
FLASK_ENV: development
FLASK_DEBUG: 1
command: gunicorn -w 5 -b 0:8000 wsgi:app
ports:
- 8000:8000
restart: unless-stopped
networks:
- aiary
ai_rabbitmq:
hostname: rabbit
container_name: ai_rabbitmq
image: rabbitmq:3-management
command: rabbitmq-server
restart: unless-stopped
environment:
- RABBITMQ_USER=guest
- RABBITMQ_PASSWORD=guest
ports:
- "5672:5672"
- "15672:15672"
depends_on:
- ai_backend
networks:
- aiary
expose:
- "15672"
ai_celery:
container_name: ai_celery
build:
context: ./Ai-flask
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- ai_backend
- ai_rabbitmq
networks:
- aiary
command:
[
"celery",
"-A",
"tasks",
"worker",
"--loglevel=info",
"--pool",
"threads",
]
ai_redis:
container_name: ai_redis
image: redis:alpine
command: redis-server --port 6000
ports:
- "6000:6000"
networks:
- aiary
networks:
aiary:
driver: bridge
volumes:
build_frontend: null