-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (27 loc) · 1.06 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
# Use 'docker compose' if you are using the plugin,
# otherwise use 'docker-compose'
COMPOSE = docker compose
# COMPOSE = sudo docker-compose
# The base docker compose YAML file
BASE_YML = docker-compose.yml
# An overriding file for Tor data persistency
PERSIST_YML = docker-compose.override.yml
.PHONY: all build up nonpersist clean fclean re
all: up
# The following two recipes shut down containers if up,
# build all images if not build and run detached containers
# Run container in hostname persistent mode
up:
$(COMPOSE) -f $(BASE_YML) -f $(PERSIST_YML) up -d --build
# Run container in hostname non-persistent mode
nonpersist:
$(COMPOSE) -f $(BASE_YML) up -d --build
# Shut all containers down and delete them
clean:
@echo "\033[33mCleaning...\033[0m"
$(COMPOSE) down -v --rmi all --remove-orphans 2> /dev/null
# Clean and delete all unused volumes, containers, networks and images
fclean: clean
docker system prune --volumes --all --force 2> /dev/null
# sudo docker system prune --volumes --all --force 2> /dev/null
re: fclean all