-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (103 loc) · 4.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (103 loc) · 4.1 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
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
# SPDX-License-Identifier: Apache-2.0
#
# HunterX v7 — AI-Powered Security Orchestration & Intelligence Platform
# Docker Compose configuration for API and CLI modes
#
# Usage:
# docker compose up -d hunterx-api
# docker compose run --rm hunterx help
# docker compose run --rm hunterx tools list
services:
# API mode — persistent FastAPI server
hunterx-api:
image: nullc0d30/hunterx:latest
build:
context: .
args:
VERSION: 7.0.1
container_name: hunterx-api
ports:
- "${HUNTERX_API_PORT:-8080}:8080"
volumes:
# Named volume: initialized from the image with hunterx:hunterx (UID 999)
# ownership. If you bind-mount a host directory instead (e.g.
# ./data:/opt/hunterx/data), it must be writable by UID 999 or SQLite
# fails with "attempt to write a readonly database" — fix with:
# sudo chown -R 999:999 ./data
- hunterx-data:/opt/hunterx/data
environment:
- HUNTERX_DATA_DIR=${HUNTERX_DATA_DIR:-/opt/hunterx/data}
- HUNTERX_DATABASE_URL=${HUNTERX_DATABASE_URL:-sqlite:////opt/hunterx/data/hunterx.db}
- HUNTERX_LOG_LEVEL=${HUNTERX_LOG_LEVEL:-INFO}
- HUNTERX_API_HOST=0.0.0.0
- HUNTERX_API_PORT=8080
- HUNTERX_API_AUTH_ENABLED=${HUNTERX_API_AUTH_ENABLED:-false}
- HUNTERX_API_API_KEY=${HUNTERX_API_KEY:-}
# AI provider configuration is passed through from the compose project
# .env file (docker compose reads .env for ${VAR} substitution); never
# hardcode keys here.
- HUNTERX_AI_PROVIDER=${HUNTERX_AI_PROVIDER:-}
- HUNTERX_AI_MODEL=${HUNTERX_AI_MODEL:-}
- HUNTERX_AI_OPENROUTER_KEY=${HUNTERX_AI_OPENROUTER_KEY:-}
- HUNTERX_AI_OPENAI_KEY=${HUNTERX_AI_OPENAI_KEY:-}
- HUNTERX_AI_ANTHROPIC_KEY=${HUNTERX_AI_ANTHROPIC_KEY:-}
- HUNTERX_AI_GEMINI_KEY=${HUNTERX_AI_GEMINI_KEY:-}
- HUNTERX_AI_DEEPSEEK_KEY=${HUNTERX_AI_DEEPSEEK_KEY:-}
- HUNTERX_AI_GROK_KEY=${HUNTERX_AI_GROK_KEY:-}
# The image ENTRYPOINT is the `hunterx` CLI; this service runs the API
# server directly, so the entrypoint is overridden for this service only.
entrypoint: ["uvicorn"]
command: ["--factory", "hunterx.api.app:create_app", "--host", "0.0.0.0", "--port", "8080"]
init: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 2g
cpus: "2"
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request, sys; urllib.request.urlopen('http://127.0.0.1:8080/health', timeout=5); sys.exit(0)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# CLI mode — run one-off commands
hunterx:
image: nullc0d30/hunterx:latest
build:
context: .
args:
VERSION: 7.0.1
container_name: hunterx-cli
profiles:
- cli
volumes:
# Same note as hunterx-api: a bind-mounted host dir must be writable by
# UID 999 (chown -R 999:999) or the CLI reports a readonly database.
- hunterx-data:/opt/hunterx/data
environment:
- HUNTERX_DATA_DIR=${HUNTERX_DATA_DIR:-/opt/hunterx/data}
- HUNTERX_DATABASE_URL=${HUNTERX_DATABASE_URL:-sqlite:////opt/hunterx/data/hunterx.db}
- HUNTERX_LOG_LEVEL=${HUNTERX_LOG_LEVEL:-INFO}
# AI provider configuration is passed through from the compose project
# .env file; never hardcode keys here.
- HUNTERX_AI_PROVIDER=${HUNTERX_AI_PROVIDER:-}
- HUNTERX_AI_MODEL=${HUNTERX_AI_MODEL:-}
- HUNTERX_AI_OPENROUTER_KEY=${HUNTERX_AI_OPENROUTER_KEY:-}
- HUNTERX_AI_OPENAI_KEY=${HUNTERX_AI_OPENAI_KEY:-}
- HUNTERX_AI_ANTHROPIC_KEY=${HUNTERX_AI_ANTHROPIC_KEY:-}
- HUNTERX_AI_GEMINI_KEY=${HUNTERX_AI_GEMINI_KEY:-}
- HUNTERX_AI_DEEPSEEK_KEY=${HUNTERX_AI_DEEPSEEK_KEY:-}
- HUNTERX_AI_GROK_KEY=${HUNTERX_AI_GROK_KEY:-}
init: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
volumes:
hunterx-data: