didi-lot1-ai/ai_platform/modules/forensic_features/docker-compose.yml

70 lines
1.6 KiB
YAML

# Forensic Features API — Docker Compose
#
# Build: docker compose build
# Up: docker compose up -d
# Logs: docker compose logs -f api
# Down: docker compose down
name: forensic-features
services:
api:
build:
context: .
dockerfile: Dockerfile
image: forensic-features:latest
container_name: forensic-features-api
restart: unless-stopped
ports:
# Localhost only — DiDi agent-v3 ajunge via didi-network DNS
- "127.0.0.1:${API_PORT:-8085}:8080"
environment:
API_HOST: "0.0.0.0"
API_PORT: "8080"
PYTHONUNBUFFERED: "1"
PYTHONDONTWRITEBYTECODE: "1"
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://didi-otel-collector:4317}
OTEL_SERVICE_NAME: forensic-features-api
volumes:
# Persistent dir for debug/artifacts (heatmaps, evidence JSON)
- api_data:/app/data
networks:
- didi-network
healthcheck:
test: ["CMD", "curl", "--fail", "--silent", "--max-time", "5",
"http://localhost:8080/health"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
# Each request consumes ~2-3 GB peak (frame extraction + MediaPipe + ffmpeg).
# Adjust based on expected concurrency.
deploy:
resources:
limits:
memory: 4G
cpus: "4.0"
reservations:
memory: 1G
cpus: "1.0"
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
volumes:
api_data:
driver: local
networks:
didi-network:
external: true