-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (86 loc) · 2.84 KB
/
Makefile
File metadata and controls
104 lines (86 loc) · 2.84 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.PHONY: help start stop restart status logs shell shell-mysql update install clean dev dev-stop dev-restart dev-logs
# Docker compose commands
DC := docker compose
DC_DEV := docker compose -f docker-compose.yaml -f docker-compose.dev.yaml
# Default target
help:
@echo "V2Board Docker Management"
@echo ""
@echo "Production commands:"
@echo " make start - Start all containers"
@echo " make stop - Stop all containers"
@echo " make restart - Restart all containers"
@echo " make status - Show container status"
@echo " make logs - Show logs from all containers"
@echo " make logs-www - Show logs from www container"
@echo " make logs-mysql - Show logs from mysql container"
@echo " make shell - Open bash shell in www container"
@echo " make shell-mysql - Open mysql shell"
@echo " make update - Update www submodule"
@echo " make install - Run initial V2Board installation"
@echo " make clean - Stop and remove all containers, networks"
@echo ""
@echo "Development commands:"
@echo " make dev - Start in development mode (localhost)"
@echo " make dev-stop - Stop development containers"
@echo " make dev-restart - Restart development containers"
@echo " make dev-logs - Show development logs"
# Start containers
start:
docker compose up -d
# Stop containers
stop:
docker compose down
# Restart containers
restart:
docker compose restart
# Show container status
status:
docker compose ps
# Show logs
logs:
docker compose logs -f
# Show www logs only
logs-www:
docker compose logs -f www
# Show mysql logs only
logs-mysql:
docker compose logs -f mysql
# Open shell in www container
shell:
docker compose exec www bash
# Open mysql shell
shell-mysql:
docker compose exec mysql mysql -uroot -p$${MYSQL_ROOT_PASSWORD:-v2boardisbest}
# Update www submodule
update:
git submodule update --remote www
@echo "Submodule updated. Run 'make restart' to apply changes."
# Initial V2Board installation
install:
@echo "Starting V2Board installation..."
@echo "Make sure containers are running first (make start)"
docker compose exec www bash -c "php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\" && php composer-setup.php && php composer.phar install"
@echo ""
@echo "Now run: make shell"
@echo "Then run: php artisan v2board:install"
@echo ""
@echo "Database configuration:"
@echo " Address: mysql"
@echo " Database: v2board (or check your .env file)"
@echo " Username: root"
@echo " Password: check your .env file (default: v2boardisbest)"
# Clean up everything
clean:
docker compose down -v
@echo "All containers and volumes removed."
# Development mode commands
dev:
$(DC_DEV) up -d
@echo "Development server started at http://localhost"
dev-stop:
$(DC_DEV) down
dev-restart:
$(DC_DEV) restart
dev-logs:
$(DC_DEV) logs -f