65 lines
1.7 KiB
Makefile
65 lines
1.7 KiB
Makefile
# Convenience commands for IoT PreTester 4.6 Demo
|
|
.PHONY: help setup build rebuild up down restart status logs logs-backend logs-frontend test check shell-backend shell-frontend migrate
|
|
|
|
help:
|
|
@echo "IoT PreTester 4.6 Demo"
|
|
@echo " make setup Create .env when needed and build the images"
|
|
@echo " make up Start the demo"
|
|
@echo " make down Stop and remove the containers"
|
|
@echo " make status Show container health"
|
|
@echo " make logs Follow all logs"
|
|
@echo " make test Run the backend test suite"
|
|
@echo " make check Check the public health endpoints"
|
|
@echo " make rebuild Rebuild and recreate both containers"
|
|
|
|
setup:
|
|
@test -f .env || cp .env.example .env
|
|
docker compose build
|
|
@echo "Edit .env if needed, then run 'make up'."
|
|
|
|
build:
|
|
docker compose build
|
|
|
|
rebuild:
|
|
docker compose up -d --build --force-recreate
|
|
|
|
up:
|
|
docker compose up -d
|
|
@echo "Frontend: http://localhost:3000"
|
|
@echo "Backend: http://localhost:8000/api/health"
|
|
|
|
down:
|
|
docker compose down
|
|
|
|
restart:
|
|
docker compose restart
|
|
|
|
status:
|
|
docker compose ps
|
|
|
|
logs:
|
|
docker compose logs -f
|
|
|
|
logs-backend:
|
|
docker compose logs -f backend
|
|
|
|
logs-frontend:
|
|
docker compose logs -f frontend
|
|
|
|
test:
|
|
docker compose exec backend python /app/django_project/manage.py test analyzer
|
|
|
|
check:
|
|
@curl --fail --silent http://localhost:8000/api/health
|
|
@curl --fail --silent http://localhost:3000/login >/dev/null
|
|
@echo "IoT PreTester 4.6 Demo is reachable."
|
|
|
|
shell-backend:
|
|
docker compose exec --workdir /app/django_project backend sh
|
|
|
|
shell-frontend:
|
|
docker compose exec frontend sh
|
|
|
|
migrate:
|
|
docker compose exec backend python /app/django_project/manage.py migrate
|