-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
42 lines (33 loc) · 1023 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
.PHONY: build run stop logs status restart
COMPOSE_FILE=docker-compose.yml
ENV_FILE=.env
DOCKER_COMPOSE=docker-compose
all: build
define print_message
@echo "\033[1;34m$(1)\033[0m"
endef
# Build and start cobi containers
build:
$(call print_message, "Building and starting the containers")
@$(DOCKER_COMPOSE) -f $(COMPOSE_FILE) up --build -d
# Start cobi with existing image
run:
$(call print_message, "Starting the containers")
@$(DOCKER_COMPOSE) -f $(COMPOSE_FILE) up -d
# Stop cobi containers
stop:
$(call print_message, "Stopping the containers")
@$(DOCKER_COMPOSE) -f $(COMPOSE_FILE) down
# View logs of the containers
logs:
$(call print_message, "Displaying logs of the containers")
@$(DOCKER_COMPOSE) -f $(COMPOSE_FILE) logs -f
# Check the status of the containers
status:
$(call print_message, "Checking the status of the containers")
@$(DOCKER_COMPOSE) -f $(COMPOSE_FILE) ps
# Restart the containers
restart:
$(call print_message, "Restarting the containers")
@$(MAKE) stop
@$(MAKE) run