mirror of
https://github.com/anyproto/any-sync-dockercompose.git
synced 2025-06-07 21:37:01 +09:00
53 lines
1.3 KiB
Makefile
53 lines
1.3 KiB
Makefile
.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/:Z \
|
|
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/
|