# Makefile cho CANIFA Chatbot

.PHONY: up down restart logs build ps clean setup-nginx monitor-up monitor-down build-dev run-dev

up:
	sudo docker compose up -d --build

down:
	docker-compose down

restart:
	docker-compose restart backend

logs:
	sudo 
ps:
	docker-compose ps

build:
	docker-compose build

build-dev:
	docker build -f Dockerfile.dev -t canifa-backend:dev .

run-dev:
	docker run -it --rm -v $(PWD):/app -p 5000:5000 canifa-backend:dev

clean:
	docker-compose down -v --rmi all --remove-orphans

setup-nginx:
	@echo "🚀 Đang cấu hình Nginx..."
	sudo cp nginx.conf /etc/nginx/sites-available/chatbot
	sudo ln -sf /etc/nginx/sites-available/chatbot /etc/nginx/sites-enabled/
	sudo nginx -t && sudo systemctl restart nginx
	@echo "✅ Nginx đã được cấu hình và restart!"

