-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (73 loc) · 2.67 KB
/
docker-compose.yml
File metadata and controls
82 lines (73 loc) · 2.67 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
services:
spare-code-context:
build:
context: spare_code_context
dockerfile: Dockerfile
image: spare-code-context:latest
volumes:
- ./data:/data # Mount local data directory
- ./predictions:/predictions # Mount local predictions directory
- ./queries:/queries # Mount local queries directory
environment:
- STAGE=${STAGE:-practice} # Default to 'public' stage if not set
- LANGUAGE=${LANGUAGE:-python} # Default to 'kotlin' language if not set
- ZOEKT_URL=http://zoekt-webserver:6070/api/search # URL of the zoekt web server
# Zoekt Web Server - provides search UI and API
zoekt-webserver:
image: zoekt-local:v0.0.1
ports:
- "6070:6070" # Default zoekt-webserver port
volumes:
- ./build/volumes/zoekt-index-data/${STAGE:-public}/${LANGUAGE:-kotlin}:/data/index:ro # Read-only access to index data
environment:
- DATA_DIR=/data/index
- GOGC=25
command: zoekt-webserver -index /data/index -pprof -rpc -listen :6070
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:6070/"]
interval: 30s
timeout: 10s
retries: 3
# Manual indexing service for local repositories
zoekt-indexer:
image: zoekt-local:v0.0.1
volumes:
- ./build/volumes/zoekt-index-data/${STAGE:-public}/${LANGUAGE:-kotlin}:/data/index
- ./data/repositories-${LANGUAGE:-kotlin}-${STAGE:-public}:/repos:ro # Mount local repos directory
working_dir: /repos
command: |
sh -c "
echo 'Starting repository indexing...'
mkdir -p /data/index
# Check if repos directory exists and has content
if [ ! -d '/repos' ]; then
echo 'Error: /repos directory not found'
exit 1
fi
# List contents of repos directory
echo 'Contents of /repos:'
ls -la /repos/
# Find and index repositories
cd /repos
for repo in */; do
if [ -d \"$$repo\" ]; then
echo \"Found directory: $$repo\"
if [ -d \"$$repo/.git\" ]; then
echo \"Indexing Git repository: $$repo\"
zoekt-git-index -index /data/index \"/repos/$$repo\"
else
echo \"Indexing directory: $$repo\"
zoekt-index -index /data/index \"/repos/$$repo\"
fi
fi
done
if [ ! -f /data/index/*.zoekt ]; then
echo 'No repositories found to index. Please add repositories to the ./repos directory'
else
echo 'Indexing complete!'
fi
"
networks:
default:
name: zoekt-network