-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (34 loc) · 853 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
DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_NAME = lendable_aggregate
CONTAINER = runner
PUID ?= 1000
PGID ?= 1000
EXEC_SHELL = /bin/sh
EXEC_USER = app
DOCKER_COMPOSE = docker-compose \
-f ${DIR}/local/docker-compose.yaml \
--project-directory $(DIR)/local \
-p ${PROJECT_NAME}
init:
@mkdir -p $(HOME)/.composer && chown $(PUID):$(PGID) $(HOME)/.composer
up: build
$(DOCKER_COMPOSE) up -d
down:
$(DOCKER_COMPOSE) down -v
start:
$(DOCKER_COMPOSE) start
stop:
$(DOCKER_COMPOSE) stop
restart:
$(DOCKER_COMPOSE) restart
ps:
$(DOCKER_COMPOSE) ps
logs:
$(DOCKER_COMPOSE) logs -f
shell:
$(DOCKER_COMPOSE) exec -u $(EXEC_USER) $(CONTAINER) $(EXEC_SHELL)
build: init
${DOCKER_COMPOSE} build
clean:
@$(DOCKER_COMPOSE) down -v --rmi local
.PHONY: init up down start stop restart ps logs shell build clean