-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
226 lines (216 loc) · 5.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
226 lines (216 loc) · 5.56 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
services:
mongodb:
build:
context: ./deployment/development/docker/mongodb
dockerfile: Dockerfile
container_name: mongodb
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
- mongodb_backup:/data/backup
networks:
- ldf-network
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=admin123
- MONGO_INITDB_DATABASE=opengin
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ]
interval: 10s
timeout: 10s
retries: 10
start_period: 60s
neo4j:
build:
context: ./deployment/development/docker/neo4j
dockerfile: Dockerfile
container_name: neo4j
ports:
- "7474:7474" # HTTP (different port to avoid conflict)
- "7687:7687" # Bolt (different port to avoid conflict)
volumes:
- neo4j_data:/neo4j_data
- neo4j_logs:/neo4j_logs
- neo4j_import:/var/lib/neo4j/import
- neo4j_plugins:/neo4j_plugins
networks:
- ldf-network
environment:
- NEO4J_AUTH=neo4j/neo4j123
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
postgres:
build:
context: ./deployment/development/docker/postgres
dockerfile: Dockerfile
container_name: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/var/lib/postgresql/backup
networks:
- ldf-network
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=opengin
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
cleanup:
build:
context: .
dockerfile: deployment/development/docker/cleanup/Dockerfile
container_name: cleanup
networks:
- ldf-network
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=opengin
- MONGO_URI=mongodb://admin:admin123@mongodb:27017/admin?authSource=admin
- MONGO_DB_NAME=opengin
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=neo4j123
depends_on:
- postgres
- mongodb
- neo4j
profiles:
- cleanup
core:
build:
context: .
dockerfile: opengin/core-api/docker/Dockerfile
container_name: core
ports:
- "50051:50051"
environment:
- NEO4J_URI=bolt://neo4j:7687
- NEO4J_USER=neo4j
- NEO4J_PASSWORD=neo4j123
- MONGO_URI=mongodb://admin:admin123@mongodb:27017/admin?authSource=admin
- MONGO_DB_NAME=opengin
- MONGO_COLLECTION=metadata
- MONGO_ADMIN_USER=admin
- MONGO_ADMIN_PASSWORD=admin123
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=opengin
- POSTGRES_SSL_MODE=disable
- CORE_SERVICE_HOST=0.0.0.0
- CORE_SERVICE_PORT=50051
depends_on:
mongodb:
condition: service_healthy
neo4j:
condition: service_healthy
postgres:
condition: service_healthy
networks:
- ldf-network
healthcheck:
test: [ "CMD", "nc", "-zv", "localhost", "50051" ]
interval: 30s
timeout: 10s
retries: 5
start_period: 120s
ingestion:
build:
context: .
dockerfile: opengin/ingestion-api/docker/Dockerfile
container_name: ingestion
ports:
- "8080:8080"
networks:
- ldf-network
environment:
- CORE_SERVICE_URL=http://core:50051
- INGESTION_SERVICE_HOST=0.0.0.0
- INGESTION_SERVICE_PORT=8080
depends_on:
core:
condition: service_healthy
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "8080" ]
interval: 15s
timeout: 10s
retries: 5
start_period: 120s
read:
build:
context: .
dockerfile: opengin/read-api/docker/Dockerfile
container_name: read
ports:
- "8081:8081"
networks:
- ldf-network
environment:
- CORE_SERVICE_URL=http://core:50051
- READ_SERVICE_HOST=0.0.0.0
- READ_SERVICE_PORT=8081
depends_on:
core:
condition: service_healthy
healthcheck:
test: [ "CMD", "nc", "-zv", "localhost", "8081" ]
interval: 15s
timeout: 10s
retries: 5
start_period: 120s
e2e:
image: python:3.9-slim
container_name: e2e
volumes:
- ./opengin/tests/e2e:/app/tests
working_dir: /app/tests
networks:
- ldf-network
environment:
- PYTHONUNBUFFERED=1
- INGESTION_SERVICE_URL=http://ingestion:8080
- READ_SERVICE_URL=http://read:8081
depends_on:
ingestion:
condition: service_healthy
read:
condition: service_healthy
command: >
sh -c "
echo 'Waiting for services to be ready...' &&
sleep 10 &&
pip install requests &&
pip install protobuf &&
pip install pandas &&
python3 basic_core_tests.py &&
python3 basic_read_tests.py"
networks:
ldf-network:
driver: bridge
volumes:
mongodb_data:
mongodb_config:
mongodb_backup:
neo4j_data:
external: true # To make sure the backup process can do the restore and get mounted externally
neo4j_logs:
neo4j_import:
neo4j_plugins:
postgres_data:
postgres_backup:
backup_data:
# Volume for backup manager