forked from chatvector-ai/chatvector-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (65 loc) · 3.55 KB
/
Makefile
File metadata and controls
75 lines (65 loc) · 3.55 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
72
73
74
75
.PHONY: help up build down reset logs db
# ==========================================
# Auto-detect Docker Compose (v1 or v2)
# ==========================================
DOCKER_COMPOSE_BIN := $(shell command -v docker-compose 2> /dev/null)
ifeq ($(DOCKER_COMPOSE_BIN),)
DOCKER_COMPOSE := docker compose
else
DOCKER_COMPOSE := docker-compose
endif
# ==========================================
# Colors
# ==========================================
GREEN=\033[0;32m
CYAN=\033[0;36m
YELLOW=\033[1;33m
RESET=\033[0m
# ==========================================
# Help
# ==========================================
help:
@echo ""
@echo "$(CYAN)"
@echo " ____ _ _ __ __ _ "
@echo " ██████╗██╗ ██╗ █████╗ ████████╗██╗ ██╗███████╗ ██████╗████████╗ ██████╗ ██████╗ █████╗ ██╗"
@echo "██╔════╝██║ ██║██╔══██╗╚══██╔══╝██║ ██║██╔════╝██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗ ██╔══██╗██║"
@echo "██║ ███████║███████║ ██║ ██║ ██║█████╗ ██║ ██║ ██║ ██║██████╔╝█████╗███████║██║"
@echo "██║ ██╔══██║██╔══██║ ██║ ╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║ ██║██╔══██╗╚════╝██╔══██║██║"
@echo "╚██████╗██║ ██║██║ ██║ ██║ ╚████╔╝ ███████╗╚██████╗ ██║ ╚██████╔╝██║ ██║ ██║ ██║██║"
@echo " ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝"
@echo "$(RESET)"
@echo ""
@echo "$(YELLOW)Available Commands$(RESET)"
@echo "-------------------------------------"
@echo "$(GREEN)make up$(RESET) 🚀 Start containers"
@echo "$(GREEN)make build$(RESET) 🔧 Rebuild & start containers"
@echo "$(GREEN)make down$(RESET) 🛑 Stop containers"
@echo "$(GREEN)make reset$(RESET) 💣 Stop and remove volumes"
@echo "$(GREEN)make logs$(RESET) 📊 Follow API logs"
@echo "$(GREEN)make db$(RESET) 🐘 Open Postgres shell"
@echo ""
@echo "Using: $(CYAN)$(DOCKER_COMPOSE)$(RESET)"
@echo ""
@echo "These are wrappers around docker compose commands."
@echo "Direct docker compose usage still works."
@echo ""
# ==========================================
# Docker Commands
# ==========================================
up:
$(DOCKER_COMPOSE) up -d
@echo "$(GREEN)🚀 ChatVector services started$(RESET)"
build:
$(DOCKER_COMPOSE) up --build -d
@echo "$(GREEN)🔧 Containers rebuilt & started$(RESET)"
down:
$(DOCKER_COMPOSE) down
@echo "$(YELLOW)🛑 Services stopped$(RESET)"
reset:
$(DOCKER_COMPOSE) down -v
@echo "$(YELLOW)💣 Containers and volumes removed$(RESET)"
logs:
$(DOCKER_COMPOSE) logs -f api
db:
$(DOCKER_COMPOSE) exec db psql -U postgres