-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (48 loc) · 1.81 KB
/
Copy pathMakefile
File metadata and controls
71 lines (48 loc) · 1.81 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
SHELL := /bin/bash
NVM_RUN := source ~/.nvm/nvm.sh 2>/dev/null || true; nvm use 2>/dev/null || true;
.PHONY: all install blackstart dev build lint typecheck test install-remote clean \
docker-build docker-run-single docker-run-multi docker-up docker-down docker-logs docker-shell docker-restart \
backup
all: build
install:
@$(NVM_RUN) pnpm install
blackstart:
@bash scripts/blackstart.sh
dev:
@$(NVM_RUN) pnpm dev
build:
@$(NVM_RUN) pnpm build
lint:
@$(NVM_RUN) pnpm lint
typecheck:
@$(NVM_RUN) pnpm typecheck
test:
@$(NVM_RUN) pnpm test
install-remote:
@bash scripts/install.sh
docker-build:
docker build -t ghcr.io/workouse/bilo-bunker:latest .
docker-run-single:
docker run -d --name bilo-bunker -p 3000:3000 -v $(PWD)/data:/data -e OWNER_NSEC=$(OWNER_NSEC) ghcr.io/workouse/bilo-bunker:latest
docker-run-multi:
docker run -d --name bilo-bunker -p 3000:3000 -v $(PWD)/data:/data -e OWNER_NPUB=$(OWNER_NPUB) ghcr.io/workouse/bilo-bunker:latest
docker-up:
docker compose up -d
docker-down:
docker compose down
docker-logs:
docker compose logs -f
docker-shell:
docker compose exec app sh
docker-restart:
docker compose restart
backup:
@mkdir -p backups
@TIMESTAMP=$$(date +%Y%m%d_%H%M%S); \
echo "Creating database backup..."; \
docker compose exec app node -e "const Database = require('better-sqlite3'); const db = new Database(process.env.DB_PATH || '/data/bunker.db'); db.backup('/data/bunker_backup.db').then(() => process.exit(0)).catch(err => { console.error(err); process.exit(1); });" && \
docker compose cp app:/data/bunker_backup.db ./backups/bunker_$${TIMESTAMP}.db && \
docker compose exec app rm -f /data/bunker_backup.db && \
echo "Backup created: backups/bunker_$${TIMESTAMP}.db"
clean:
rm -rf node_modules packages/*/node_modules packages/*/dist .wrangler nginx/nginx.conf