-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
104 lines (96 loc) · 3.53 KB
/
docker-compose.yaml
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
services:
kg_generator:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- .env
volumes:
- ./assets:/app/assets # Map the 'assets' folder to the container
- ./txt_files:/app/txt_files # Map the 'txt_files' folder to the container
- ./backend:/app/backend # Map the 'backend' folder to the container
working_dir: /app/backend # Set working directory to /app/backend
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
ports:
- "${KGGENRATOR}:8080"
neo4j:
image: neo4j:5.23.0 # Use the specific Neo4j version
container_name: neo4j
ports:
- "7474:7474" # HTTP port for Neo4j Browser
- "7687:7687" # Bolt port for Neo4j client connections
environment:
- NEO4J_AUTH=neo4j/test@123 # Disable authentication; adjust as needed
- NEO4J_apoc_export_file_enabled=true # Enable APOC export file
- NEO4J_apoc_import_file_enabled=true # Enable APOC import file
- NEO4J_apoc_import_file_use__neo4j__config=true # Enable APOC import using Neo4j config
- NEO4J_PLUGINS=["graph-data-science","apoc"] # Install both GDS and APOC plugins
volumes:
- ./neo4j_db/data:/data
- ./neo4j_db/logs:/logs
- ./neo4j_db/import:/var/lib/neo4j/import
- ./neo4j_db/plugins:/plugins
healthcheck:
test: wget http://localhost:7474 || exit 1
interval: 1s
timeout: 10s
retries: 20
start_period: 120s
neo4j_uploader:
build:
context: ./upload_db # Build context is set to the upload_db directory
dockerfile: Dockerfile # Dockerfile is inside the upload_db directory
env_file:
- .env
volumes:
- ./assets:/app/assets # Map 'assets' folder to the container
- ./upload_db:/app/upload_db # Map 'upload_db' folder to the container
working_dir: /app/upload_db # Set working directory to /app/upload_db
depends_on:
kg_generator:
condition: service_completed_successfully # Ensure this service waits for kg_generator to finish
neo4j:
condition: service_healthy # Ensure neo4j service is started
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- NEO4J_URI=bolt://neo4j:7687 # Environment variable to access Neo4j URL
- NEO4J_USERNAME=neo4j # Environment variable for Neo4j username
- NEO4J_PASSWORD=test@123 # Environment variable for Neo4j password
command: /bin/bash -c "python upload_neo4j_from_json.py && python create_vector_db_and_clustering.py"
flask_backend:
build:
context: ./react_chat_app/backend
dockerfile: Dockerfile
env_file:
- .env
volumes:
- ./react_chat_app/backend:/app # Map the 'backend' folder to the container
ports:
- "5001:5001"
environment:
- FLASK_ENV=development
- OPENAI_API_KEY=${OPENAI_API_KEY}
- NEO4J_URI=bolt://neo4j:7687 # Environment variable to access Neo4j URL
- NEO4J_USERNAME=neo4j # Environment variable for Neo4j username
- NEO4J_PASSWORD=test@123 # Environment variable for Neo4j password
depends_on:
- neo4j_uploader
- neo4j
- kg_generator
frontend:
build:
context: ./react_chat_app/frontend
dockerfile: Dockerfile
args:
- REACT_APP_BACKEND_SERVER=http://flask_backend:5001
volumes:
- ./react_chat_app/frontend:/app # Map the 'frontend' folder to the container
environment:
- REACT_APP_BACKEND_SERVER=http://localhost:5001
ports:
- "3000:80"
depends_on:
- flask_backend
volumes:
neo4j_data: