-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
52 lines (39 loc) · 1009 Bytes
/
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
#!/usr/bin/make
ENV_FILE ?= .env
DOCKER_COMPOSE=docker-compose --env-file=${ENV_FILE}
.DEFAULT_GOAL := up
#----------------#
# Docker Compose #
#----------------#
up:
@echo "🥫 Building and starting containers …"
${DOCKER_COMPOSE} up -d --build 2>&1
down:
@echo "🥫 Bringing down containers …"
${DOCKER_COMPOSE} down
hdown:
@echo "🥫 Bringing down containers and associated volumes …"
${DOCKER_COMPOSE} down -v
reset: hdown up
restart:
@echo "🥫 Restarting containers …"
${DOCKER_COMPOSE} restart
status:
@echo "🥫 Getting container status …"
${DOCKER_COMPOSE} ps
livecheck:
@echo "🥫 Running livecheck …"
docker/docker-livecheck.sh
log:
@echo "🥫 Reading logs (docker-compose) …"
${DOCKER_COMPOSE} logs -f
#---------#
# Cleanup #
#---------#
prune:
@echo "🥫 Pruning unused Docker artifacts (save space) …"
docker system prune -af
prune_cache:
@echo "🥫 Pruning Docker builder cache …"
docker builder prune -f
clean: hdown prune prune_cache