-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (32 loc) · 971 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
ENV_FILE = .env
include $(ENV_FILE)
DOCKER = docker
COMPOSE = $(DOCKER) compose --env-file $(ENV_FILE)
all: prod
prod: docker-compose.prod.yml prod.build prod.upd
dev: docker-compose.dev.yml dev.build dev.upd
db: docker-compose.db.yml db.build db.upd
%.upd: $(ENV_FILE)
$(COMPOSE) -f docker-compose.$*.yml up -d
%.up: $(ENV_FILE)
$(COMPOSE) -f docker-compose.$*.yml up
%.start:
$(COMPOSE) -f docker-compose.$*.yml start
%.stop:
$(COMPOSE) -f docker-compose.$*.yml stop
%.down:
$(COMPOSE) -f docker-compose.$*.yml down
%.restart: $(ENV_FILE)
$(COMPOSE) -f docker-compose.$*.yml restart
%.build:
$(COMPOSE) -f docker-compose.$*.yml build
%.ps:
$(COMPOSE) -f docker-compose.$*.yml ps
%.logs:
$(COMPOSE) -f docker-compose.$*.yml logs -f
%.clean:
$(COMPOSE) -f docker-compose.$*.yml down -v
fclean: dev.clean prod.clean db.clean
$(DOCKER) system prune -a --volumes -f
re: fclean prod
.PHONY: all dir upd up stop down restart build clean ps re