-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (49 loc) · 1.18 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
54
55
56
57
58
59
60
61
62
63
.PHONY: all init clone build rebuild up stop restart status
DC := docker-compose
DR := docker
all: up
status:
@echo "*** Containers statuses ***"
$(DC) ps
build: stop
@echo "*** Building containers... ***"
$(DC) build
rebuild: stop
@echo "*** Rebuilding containers... ***"
$(DC) build --no-cache
up:
@echo "*** Spinning up containers mom implementation... ***"
docker-compose up -d
@$(MAKE) --no-print-directory status
stop:
@echo "*** Halting containers... ***"
$(DC) stop
@$(MAKE) --no-print-directory status
down:
@echo "*** Removing containers... ***"
$(DC) down
@$(MAKE) --no-print-directory status
# Restart
restart:
@echo "*** Restarting containers... ***"
@$(MAKE) --no-print-directory stop
@$(MAKE) --no-print-directory up
restart-short-url:
@echo "*** Restarting short_url... ***"
$(DC) restart short_url
# Console
console-short-url:
$(DC) exec short_url sh
# Mongo shell
console-mongo:
$(DR) exec -it mongo mongo
# Logs
logs-short-url:
$(DC) logs -f -t --tail 30 short_url
logs-mongo:
$(DC) logs -f -t --tail 30 mongo
clean:
@echo "*** Removing containers. All data will be lost!!!... ***"
$(DC) down --rmi all
@rm -rf mongo/db/*
@rm -rf mongo/dump/*