79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
# Copyright (c) StellaOps. All rights reserved.
|
|
# Licensed under BUSL-1.1.
|
|
|
|
# BSim PostgreSQL Database and Ghidra Headless Services
|
|
#
|
|
# Usage:
|
|
# docker compose -f docker-compose.bsim.yml up -d
|
|
#
|
|
# Environment variables:
|
|
# BSIM_DB_PASSWORD - PostgreSQL password for BSim database
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
bsim-postgres:
|
|
image: postgres:18.1-alpine
|
|
container_name: stellaops-bsim-db
|
|
environment:
|
|
POSTGRES_DB: bsim_corpus
|
|
POSTGRES_USER: bsim_user
|
|
POSTGRES_PASSWORD: ${BSIM_DB_PASSWORD:-stellaops_bsim_dev}
|
|
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
|
|
volumes:
|
|
- bsim-data:/var/lib/postgresql/data
|
|
- ./scripts/init-bsim.sql:/docker-entrypoint-initdb.d/10-init-bsim.sql:ro
|
|
ports:
|
|
- "5433:5432"
|
|
networks:
|
|
- stellaops-bsim
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U bsim_user -d bsim_corpus"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
# Ghidra Headless service for BSim analysis
|
|
ghidra-headless:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.headless
|
|
image: stellaops/ghidra-headless:11.2
|
|
container_name: stellaops-ghidra
|
|
depends_on:
|
|
bsim-postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
BSIM_DB_URL: "postgresql://bsim-postgres:5432/bsim_corpus"
|
|
BSIM_DB_USER: bsim_user
|
|
BSIM_DB_PASSWORD: ${BSIM_DB_PASSWORD:-stellaops_bsim_dev}
|
|
JAVA_HOME: /opt/java/openjdk
|
|
MAXMEM: 4G
|
|
volumes:
|
|
- ghidra-projects:/projects
|
|
- ghidra-scripts:/scripts
|
|
- ghidra-output:/output
|
|
networks:
|
|
- stellaops-bsim
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '4'
|
|
memory: 8G
|
|
# Keep container running for ad-hoc analysis
|
|
entrypoint: ["tail", "-f", "/dev/null"]
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
bsim-data:
|
|
driver: local
|
|
ghidra-projects:
|
|
ghidra-scripts:
|
|
ghidra-output:
|
|
|
|
networks:
|
|
stellaops-bsim:
|
|
driver: bridge
|
|
|