-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (56 loc) · 1.62 KB
/
Makefile
File metadata and controls
71 lines (56 loc) · 1.62 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
66
67
68
69
70
71
.PHONY: help build up down logs shell test lint format clean
# Default target
help:
@echo "Available commands:"
@echo " make build - Build Docker images"
@echo " make up - Start all services"
@echo " make up-dev - Start all services in development mode"
@echo " make down - Stop all services"
@echo " make logs - View logs from all services"
@echo " make shell - Open shell in API container"
@echo " make test - Run tests"
@echo " make lint - Run linting"
@echo " make format - Format code"
@echo " make clean - Clean up volumes and cache"
# Build Docker images
build:
docker compose build
# Start services in production mode
up:
docker compose up -d
# Start services in development mode
up-dev:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
down-dev:
docker compose -f docker-compose.yml -f docker-compose.dev.yml down
restart-api:
docker compose -f docker-compose.yml -f docker-compose.dev.yml restart api
flush-redis:
docker exec ptr_redis redis-cli FLUSHALL
# Stop all services
down:
docker compose down
# View logs
logs:
docker compose logs -f
# Open shell in API container
shell:
docker compose exec api /bin/bash
# Run tests
test:
docker compose exec api pytest tests/ -v
# Run linting
lint:
docker compose exec api ruff check src/
# Format code
format:
docker compose exec api black src/
# Clean up
clean:
docker compose down -v
rm -rf qdrant_storage/ redis_data/ redisinsight/
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
# Development shortcuts
dev: up-dev
prod: up