-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (69 loc) · 2.4 KB
/
Copy pathMakefile
File metadata and controls
85 lines (69 loc) · 2.4 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
76
77
78
79
80
81
82
83
84
85
.PHONY: help build up down restart logs clean dev backend-dev frontend-dev install
# Detect OS and set Docker Compose command
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
DOCKER_COMPOSE = docker compose
else ifeq ($(UNAME_S),Linux)
DOCKER_COMPOSE = docker-compose
else
DOCKER_COMPOSE = docker-compose
endif
help:
@echo "Available commands:"
@echo " make build - Build all Docker images"
@echo " make up - Start all containers"
@echo " make down - Stop all containers"
@echo " make restart - Restart all containers"
@echo " make logs - View logs from all containers"
@echo " make clean - Remove all containers, images, and volumes"
@echo " make dev - Start development mode (hot reload)"
@echo " make backend-dev - Start backend in development mode"
@echo " make frontend-dev - Start frontend in development mode"
@echo " make install - Install dependencies for both backend and frontend"
build:
@echo "Building Docker images..."
$(DOCKER_COMPOSE) build
build-clean:
@echo "Building Docker images..."
$(DOCKER_COMPOSE) build --no-cache
up:
@echo "Starting containers..."
$(DOCKER_COMPOSE) up -d
@echo "Dashboard available at http://localhost"
@echo "Backend API available at http://localhost:3001"
down:
@echo "Stopping containers..."
$(DOCKER_COMPOSE) down
restart: down up
logs:
$(DOCKER_COMPOSE) logs -f
logs-backend:
$(DOCKER_COMPOSE) logs -f backend
logs-frontend:
$(DOCKER_COMPOSE) logs -f frontend
clean:
@echo "Cleaning up..."
$(DOCKER_COMPOSE) down -v --rmi all
@echo "Cleanup complete"
install:
@echo "Installing backend dependencies..."
cd backend && npm install
@echo "Installing frontend dependencies..."
cd frontend && npm install
@echo "Dependencies installed"
backend-dev:
@echo "Starting backend in development mode..."
cd backend && npm run dev
frontend-dev:
@echo "Starting frontend in development mode..."
cd frontend && npm run dev
dev:
@echo "Starting development environment..."
@echo "Run 'make backend-dev' in one terminal and 'make frontend-dev' in another"
config:
@mkdir -p data
@if [ ! -f data/config.json ]; then \
echo "Creating example config..."; \
echo '{"servers":[],"commandButtons":[],"statusWidgets":[],"quickLinks":[],"layout":{"buttons":[],"widgets":[],"links":[]}}' > data/config.json; \
fi
@echo "Config file available at data/config.json"