-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·124 lines (115 loc) · 4.32 KB
/
docker-compose.yml
File metadata and controls
executable file
·124 lines (115 loc) · 4.32 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
services:
# virtuoso:
# build:
# context: .
# dockerfile: Dockerfile.virtuoso
# # Ports commented out as they'll be accessed through nginx
# # Uncomment for direct access during development if needed
# # ports:
# # - "127.0.0.1:8890:8890" # SPARQL and HTTP
# # - "127.0.0.1:1111:1111" # SQL port
# environment:
# # ONTOLOGY_FILE is the path *inside* the container where load_ontology.sh expects it
# - ONTOLOGY_FILE=${ONTOLOGY_FILE} # Default to pizza.owl if not set
# volumes:
# - ./data:/data # Mount local data dir into container's /data
# - virtuoso_data:/opt/virtuoso-opensource/database/data
# - virtuoso_logs:/opt/virtuoso-opensource/database/logs
# restart: unless-stopped
ontology-api:
build:
context: .
dockerfile: Dockerfile.api
# Ports commented out as they'll be accessed through nginx
# Uncomment for direct access during development if needed
# ports:
# - "127.0.0.1:8080:8080" # API port
environment:
- ABEROWL_PUBLIC_URL=${ABEROWL_PUBLIC_URL}
- ABEROWL_REGISTER=${ABEROWL_REGISTER}
- ABEROWL_CENTRAL_URL=${ABEROWL_CENTRAL_URL}
volumes:
# Mount the data directory containing ontologies
- ./data:/data
- ./aberowlapi:/app/aberowlapi
# Command uses the ONTOLOGY_FILE env var which should be the path inside the container
command: python3 /app/api_server.py ${ONTOLOGY_FILE}
networks:
- default
- aberowl-net
restart: unless-stopped
elasticsearch:
image: elasticsearch:7.17.10 # Use a 7.x version compatible with the groovy script client
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms512m -Xmx512m # Adjust memory as needed
# Ports commented out as they'll be accessed through nginx
# Uncomment for direct access during development if needed
# ports:
# - "127.0.0.1:9200:9200" # HTTP port
# - "127.0.0.1:9300:9300" # Transport port
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -s --fail http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=5s || exit 1"]
interval: 10s
timeout: 10s
retries: 5
indexer:
build:
context: .
dockerfile: Dockerfile.indexer
environment:
# These are passed via reload_docker.sh or .env file
- ONTOLOGY_FILE_PATH=${ONTOLOGY_FILE} #:-/data/pizza.owl} # Default to pizza.owl if not set
- ELASTICSEARCH_URL=http://elasticsearch:9200
- ONTOLOGY_INDEX_NAME=${ONTOLOGY_INDEX_NAME:-ontology_index}
- CLASS_INDEX_NAME=${CLASS_INDEX_NAME:-owl_class_index}
- SKIP_EMBEDDING=${SKIP_EMBEDDING:-True}
- ES_USERNAME=${ES_USERNAME:-} # Add username if needed
- ES_PASSWORD=${ES_PASSWORD:-} # Add password if needed
volumes:
- ./data:/data # Mount ontology data
- ./docker/scripts:/scripts # Mount scripts including IndexElastic.groovy and run_indexer.sh
depends_on:
elasticsearch:
condition: service_healthy # Wait for elasticsearch to be healthy
command: /scripts/run_indexer.sh # This script will execute the groovy script
# This service should run once to index, then stop.
# Use 'profiles' if you only want to run it explicitly: docker compose --profile indexer up
# Or let it run on 'up', and it will exit after indexing. 'restart: no' ensures it doesn't restart.
restart: 'no'
nginx:
build:
context: .
dockerfile: Dockerfile.nginx
ports:
- "${NGINX_PORT}:80" # Expose configurable nginx port to the outside world
depends_on:
- ontology-api
- elasticsearch
volumes:
# Optional: Mount the frontend files if you're serving them via nginx
- ./:/usr/share/nginx/html
# llm:
# build:
# context: .
# dockerfile: Dockerfile.llm
# # Ports commented out as they'll be accessed through nginx
# # Uncomment for direct access during development if needed
# # ports:
# # - "127.0.0.1:8000:8000" # FastAPI port
# environment:
# - OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
# restart: unless-stopped
# depends_on:
# - ontology-api
volumes:
# virtuoso_data:
# virtuoso_logs:
elasticsearch_data:
networks:
default:
aberowl-net:
external: true