forked from Sylius/Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (48 loc) · 1.24 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
include .stub/*.mk
$(eval $(call defw,DOCKER_COMPOSE_LOCAL,docker-compose.local.yml))
$(eval $(call defw,PROJECT,sylius-standard))
$(eval $(call defw,NAME,$(PROJECT)))
UNAME_S := $(shell uname -s)
ifneq ("$(wildcard $(DOCKER_COMPOSE_LOCAL))","")
DOCKER_COMPOSE_EXTRA_OPTIONS := -f $(DOCKER_COMPOSE_LOCAL)
endif
ifeq (Linux,$(UNAME_S))
$(eval $(call defw,AS_UID,$(shell id -u)))
endif
# Deps
has_created_containers := $(shell docker ps -a -f "name=${NAME}" --format="{{.ID}}")
.PHONY: build
build:: ##@Docker Build the Sylius application image
docker build \
-f Dockerfile \
.
.PHONY: up
up:: ##@Sylius Start the Sylius stack for development (using docker-compose)
docker-compose \
-f docker-compose.yml \
-p $(PROJECT) \
$(DOCKER_COMPOSE_EXTRA_OPTIONS) \
up \
--build
.PHONY: rm
rm:: ##@Compose Clean docker-compose stack
docker-compose \
rm \
--force
ifneq ($(has_created_containers),)
docker rm -f $(has_created_containers)
endif
.PHONY: shell
shell:: ##@Development Bring up a shell
docker exec \
-ti \
-u www-data \
${NAME}-app \
bash
.PHONY: console
console:: ##@Development Call Symfony "console" with "console [<CMD>]"
docker exec \
-ti \
-u www-data \
${NAME}-app \
sylius/bin/console $(CMD)