-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile
53 lines (43 loc) · 1.31 KB
/
Makefile
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
.DEFAULT_GOAL := start
# Check if the 's' flag (silent/quiet mode) is present in MAKEFLAGS
ifeq ($(findstring s,$(MAKEFLAGS)),s)
QUIET_MODE := true
DOCKER_COMPOSE := docker compose --progress=quiet
else
QUIET_MODE := false
DOCKER_COMPOSE := docker compose
endif
# targets
generate_env:
ifeq ($(QUIET_MODE),true)
docker buildx build --quiet --load --tag generateconfig-env --file Dockerfile-generateconfig-env . >/dev/null
else
docker buildx build --load --tag generateconfig-env --file Dockerfile-generateconfig-env .
endif
docker run --rm \
--volume ${CURDIR}/:/code/ \
generateconfig-env
start: generate_env
$(DOCKER_COMPOSE) up --detach --remove-orphans --quiet-pull
ifeq ($(QUIET_MODE),false)
@echo "Done! Upload your self-hosted network configuration file ${CURDIR}/etc/client.yml into the client app"
@echo "See: https://doc.anytype.io/anytype-docs/data-and-security/self-hosting#switching-between-networks"
endif
stop:
$(DOCKER_COMPOSE) stop
clean:
docker system prune --all --volumes
pull:
$(DOCKER_COMPOSE) pull
down:
$(DOCKER_COMPOSE) down --remove-orphans
logs:
$(DOCKER_COMPOSE) logs --follow
# build with "plain" log for debug
build:
$(DOCKER_COMPOSE) build --no-cache --progress plain
restart: down start
update: pull down start
upgrade: down clean start
cleanEtcStorage:
rm -rf etc/ storage/