Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # lf_mri_platform — unified microservice stack
  2. # Requires: Docker Desktop with Compose v2, GNU make (or nmake on Windows)
  3. #
  4. # Usage:
  5. # make plug — start all services in stub mode (no hardware)
  6. # make real — start all services in real mode (live hardware)
  7. # make down — stop and remove containers
  8. # make logs — tail logs from all services
  9. # make health — check all service health endpoints
  10. # make restart svc=orchestrator — restart a single service
  11. .PHONY: up down plug real logs health restart build ps
  12. ENV_FILE := .env
  13. # ── Startup targets ──────────────────────────────────────────────────────────
  14. up: $(ENV_FILE)
  15. docker compose --env-file $(ENV_FILE) up --build -d
  16. plug: $(ENV_FILE)
  17. ORCHESTRATOR_MODE=plug docker compose --env-file $(ENV_FILE) up --build -d
  18. real: $(ENV_FILE)
  19. ORCHESTRATOR_MODE=real docker compose --env-file $(ENV_FILE) up --build -d
  20. down:
  21. docker compose down
  22. build:
  23. docker compose --env-file $(ENV_FILE) build
  24. # ── Monitoring ───────────────────────────────────────────────────────────────
  25. logs:
  26. docker compose logs -f
  27. ps:
  28. docker compose ps
  29. restart:
  30. docker compose restart $(svc)
  31. # ── Health checks ────────────────────────────────────────────────────────────
  32. health:
  33. @echo "orchestrator :" && curl -sf http://localhost:$${ORCHESTRATOR_PORT:-1717}/health || echo "OFFLINE"
  34. @echo "seq-interp :" && curl -sf http://localhost:$${SEQ_INTERP_PORT:-7475}/health || echo "OFFLINE"
  35. @echo "spectrometer :" && curl -sf http://localhost:$${SPECTROMETER_PORT:-8000}/api/ || echo "OFFLINE"
  36. @echo "reconstructor :" && curl -sf http://localhost:$${RECONSTRUCTOR_PORT:-8081}/health || echo "OFFLINE"
  37. @echo "spectroscopy :" && curl -sf http://localhost:$${SPECTROSCOPY_PORT:-8002}/health || echo "OFFLINE"
  38. # ── Bootstrap ────────────────────────────────────────────────────────────────
  39. $(ENV_FILE):
  40. @echo "Creating .env from .env.example..."
  41. cp .env.example $(ENV_FILE)