-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (95 loc) · 3.17 KB
/
docker-compose.yml
File metadata and controls
102 lines (95 loc) · 3.17 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
services:
security_pattern_miner:
build:
context: ./security_pattern_miner
dockerfile: securityPatternMiner.dockerfile
image: security_pattern_miner:latest
volumes:
- ./build/volumes/data:/data
env_file:
- ./.env
command: ["python", "./runner.py", "--get_dependents", "--pattern", "password_based_authentication", "--web_framework", "fastapi", "--language", "python", "--package_manager", "Pypi", "--root_data_dir=/data", "--crawl"]
deploy:
resources:
limits:
cpus: '8.0'
memory: 10G
reservations:
cpus: '4.0'
memory: 4G
security_pattern_extractor:
build:
context: ./security_pattern_miner
dockerfile: securityPatternMiner.dockerfile
image: security_pattern_miner:latest
volumes:
- ./build/volumes/data:/data
env_file:
- ./.env
environment:
- ZOEKT_URL=http://zoekt-webserver:6070/api/search
command: ["python", "./runner.py", "--construct_queries", "--search_queries", "--pattern", "password_based_authentication", "--web_framework", "fastapi", "--language", "python", "--root_data_dir=/data"]
depends_on:
- zoekt-webserver
deploy:
resources:
limits:
cpus: '8.0'
memory: 10G
reservations:
cpus: '4.0'
memory: 4G
zoekt-webserver:
image: zoekt-local
ports:
- "6070:6070" # Default zoekt-webserver port
volumes:
- ./build/volumes/zoekt/index-data:/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
zoekt-indexer:
image: zoekt-local
volumes:
- ./build/volumes/zoekt/index-data:/data/index
- ./build/volumes/data/cloned_repos:/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
"