-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (56 loc) · 1.78 KB
/
Makefile
File metadata and controls
65 lines (56 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: help build up down logs test clean dev
# Auto-detect container runtime (podman or docker)
CONTAINER_RUNTIME := $(shell command -v podman 2>/dev/null)
ifdef CONTAINER_RUNTIME
COMPOSE := podman-compose
RUNTIME_NAME := Podman
else
CONTAINER_RUNTIME := $(shell command -v docker 2>/dev/null)
COMPOSE := docker-compose
RUNTIME_NAME := Docker
endif
help:
@echo "capa-server - Makefile commands"
@echo ""
@echo "Detected runtime: $(RUNTIME_NAME)"
@echo ""
@echo " make build - Build container image"
@echo " make up - Start the service"
@echo " make down - Stop the service"
@echo " make logs - View logs"
@echo " make test - Test API endpoints"
@echo " make clean - Clean up containers and data"
@echo " make dev - Run development server (no container)"
@echo ""
build:
@echo "Building with $(RUNTIME_NAME)..."
$(COMPOSE) build
up:
@echo "Starting capa-server with $(RUNTIME_NAME)..."
$(COMPOSE) up -d
@echo ""
@echo "✓ capa-server is starting..."
@echo " Web UI: http://localhost:8080"
@echo " API docs: http://localhost:8080/docs"
@echo ""
@echo "Run 'make logs' to view output"
down:
$(COMPOSE) down
logs:
$(COMPOSE) logs -f
test:
@echo "Testing API endpoints..."
@echo ""
@curl -f http://localhost:8080/health 2>/dev/null && echo "✓ Health check passed" || echo "✗ Service not responding"
@echo ""
@curl -s http://localhost:8080/api/info 2>/dev/null | python3 -m json.tool || echo "✗ API not responding"
clean:
@echo "Cleaning up..."
$(COMPOSE) down -v
rm -rf data/
@echo "✓ Cleaned up containers and data"
dev:
@echo "Starting development server..."
@echo "Make sure you have installed dependencies: pip install -r requirements.txt"
@echo ""
uvicorn app.main:app --reload --host 0.0.0.0 --port 8080