forked from stampchain-io/btc_stamps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (56 loc) · 1.76 KB
/
Makefile
File metadata and controls
68 lines (56 loc) · 1.76 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
.PHONY: up down detect-arch
ARCH := $(shell uname -m)
DOCKER_PLATFORM :=
ifeq ($(ARCH),x86_64)
DOCKER_PLATFORM = linux/amd64
else ifeq ($(ARCH),aarch64)
DOCKER_PLATFORM = linux/arm64
else ifeq ($(ARCH),arm64)
DOCKER_PLATFORM = linux/arm64
else
$(error Unsupported architecture: $(ARCH))
endif
up:
@echo "Using arch: $(ARCH)"
@echo "Using platform: $(DOCKER_PLATFORM)"
@cd docker && DOCKER_PLATFORM=$(DOCKER_PLATFORM) docker compose up --build
dup:
@echo "Using arch: $(ARCH)"
@echo "Using platform: $(DOCKER_PLATFORM)"
@cd docker && DOCKER_PLATFORM=$(DOCKER_PLATFORM) docker compose up --build -d
logs: dup
@cd docker && docker compose logs -f indexer
db:
@echo "Using arch: $(ARCH)"
@echo "Using platform: $(DOCKER_PLATFORM)"
@cd docker && DOCKER_PLATFORM=$(DOCKER_PLATFORM) docker compose up --build -d db adminer
app: db
@echo "Using arch: $(ARCH)"
@echo "Using platform: $(DOCKER_PLATFORM)"
@cd docker && DOCKER_PLATFORM=$(DOCKER_PLATFORM) docker compose up --build -d app
@cd docker && docker compose logs -f app
dev:
@echo "Using arch: $(ARCH)"
@echo "Using platform: $(DOCKER_PLATFORM)"
@cd docker && DOCKER_PLATFORM=$(DOCKER_PLATFORM) docker compose up --build -d indexer db adminer
@docker compose logs -f indexer db
down:
@cd docker && docker compose down
fdown:
@cd docker && docker compose down -v
@rm -rf files || true
@rm -rf indexer/files || true
@rm -rf */__pycache__ || true
@rm -rf */*/__pycache__ || true
@rm -rf indexer/log.file || true
@rm -rf docker/db_data || true
clean: fdown
@rm -rf files || true
@rm -rf indexer/files || true
@rm -rf */__pycache__ || true
@rm -rf */*/__pycache__ || true
@rm -rf indexer/log.file || true
@rm -rf docker/db_data || true
fclean: clean
@cd docker && docker system prune -a -f
redo: clean up