Files
Aidem-Media-DLL-Analysis/docker-compose.yml
Patryk Gensch ba9db82a4c worker: optional PyGhidra back-end for Ghidra 11.4+/12.x (no Jython)
The .py extractor runs fine under PyGhidra in the GUI; only `analyzeHeadless`
doesn't init PyGhidra. Add an env-gated CPython path so modern Ghidra works headless:

- ghidra.run_extractor_pyghidra(): runs the same GhidraScript via pyghidra.run_script
  (boots Ghidra in-process, imports+analyses, getScriptArgs()=[out_path]); run_extractor
  dispatches to it when AMS_USE_PYGHIDRA is set. No script changes needed.
- worker image installs pyghidra + sets GHIDRA_INSTALL_DIR; compose exposes
  AMS_USE_PYGHIDRA (default off). Jython path stays the default and untouched.
- README documents both variants (Jython <=11.3.x vs PyGhidra 11.4+/12.x).
- test: AMS_USE_PYGHIDRA routes to the PyGhidra back-end (clear error if pkg missing).

35/35 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:03:04 +02:00

76 lines
2.0 KiB
YAML

# Aidem Media Playground — full stack.
#
# db Postgres (durable catalog)
# redis job queue broker
# api FastAPI + Command Center UI (http://localhost:8000)
# worker Ghidra-headless acquisition worker (drains the 'acquire' queue)
#
# api and worker share the `uploads` volume: the API streams an uploaded archive there,
# the worker reads it back by path. Bring it up with: docker compose up --build
#
# NOTE: the worker image downloads Ghidra (~1 GB) on first build — that layer is slow but cached.
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ams
POSTGRES_PASSWORD: ams
POSTGRES_DB: ams
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ams"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
api:
build:
context: .
dockerfile: docker/api.Dockerfile
environment:
DATABASE_URL: postgresql+psycopg://ams:ams@db:5432/ams
REDIS_URL: redis://redis:6379/0
AMS_UPLOAD_DIR: /data/uploads
ports:
- "8000:8000"
volumes:
- uploads:/data/uploads
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
worker:
build:
context: .
dockerfile: docker/worker.Dockerfile
environment:
DATABASE_URL: postgresql+psycopg://ams:ams@db:5432/ams
REDIS_URL: redis://redis:6379/0
AMS_UPLOAD_DIR: /data/uploads
# Set to 1 (e.g. `AMS_USE_PYGHIDRA=1 docker compose up`) to run the extractor through
# PyGhidra instead of Jython - needed for Ghidra 11.4+/12.x (build worker with that GHIDRA_URL).
AMS_USE_PYGHIDRA: ${AMS_USE_PYGHIDRA:-}
volumes:
- uploads:/data/uploads
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
pgdata:
uploads: