-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
141 lines (133 loc) · 2.92 KB
/
docker-compose.prod.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
version: '3'
services:
redis:
image: 'redis'
volumes:
- ./volumes/redis:/data
text_similarity:
image: 'dishabhardwaj/textsimilarity_app:latest'
app_server:
networks:
default:
ports:
- '12400-12500:8989'
build: .
command: npm start
environment:
- MONGODB_URL=mongodb://mongo1:27017,mongo2:27018,mongo3:27019/enormoDB?retryWrites=true&w=majority
- REDIS_HOST=redis
depends_on:
- mongo-setup
- mongo1
- mongo2
- mongo3
- redis
- text_similarity
env_file:
- ./.env
restart: always
volumes:
- ./logs:/var/log
app_nginx:
image: nginx:latest
container_name: nginx
restart: always
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf
ports:
- 5000:80
networks:
default:
depends_on:
- app_server
mongo-setup:
container_name: mongo-setup
image: mongo
restart: on-failure
networks:
default:
volumes:
- ./scripts:/scripts
entrypoint: ['/scripts/setup.sh'] # Make sure this file exists (see below for the setup.sh)
depends_on:
- mongo1
- mongo2
- mongo3
mongo1:
hostname: mongo1
image: mongo
expose:
- 27017
ports:
- 27017:27017
restart: always
networks:
default:
entrypoint:
[
'/usr/bin/mongod',
'--quiet',
'--logpath',
'/dev/null',
'--bind_ip_all',
'--replSet',
'rs0',
'--journal',
'--dbpath',
'/data/db',
]
volumes:
- ./volumes/mongodb/mongo/data1/db:/data/db # This is where your volume will persist. e.g. VOLUME-DIR = ./volumes/mongodb
- ./volumes/mongodb/mongo/data1/configdb:/data/configdb
mongo2:
hostname: mongo2
image: mongo
expose:
- 27017
ports:
- 27018:27017
restart: always
networks:
default:
entrypoint:
[
'/usr/bin/mongod',
'--quiet',
'--logpath',
'/dev/null',
'--bind_ip_all',
'--replSet',
'rs0',
'--journal',
'--dbpath',
'/data/db',
]
volumes:
- ./volumes/mongodb/mongo/data2/db:/data/db # This is where your volume will persist. e.g. VOLUME-DIR = ./volumes/mongodb
- ./volumes/mongodb/mongo/data2/configdb:/data/configdb
mongo3:
hostname: mongo3
image: mongo
expose:
- 27017
ports:
- 27019:27017
restart: always
networks:
default:
entrypoint:
[
'/usr/bin/mongod',
'--quiet',
'--logpath',
'/dev/null',
'--bind_ip_all',
'--replSet',
'rs0',
'--journal',
'--dbpath',
'/data/db',
]
volumes:
- ./volumes/mongodb/mongo/data3/db:/data/db # This is where your volume will persist. e.g. VOLUME-DIR = ./volumes/mongodb
- ./volumes/mongodb/mongo/data3/configdb:/data/configdb