-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
68 lines (54 loc) · 1.8 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
64
65
66
67
68
# Makefile
all:
@echo "We are building all containers and then running them via docker-compose"
@$(MAKE) clean
@$(MAKE) build-containers
@$(MAKE) compose-containers
local:
@echo "We are building all containers and then running them via docker-compose"
@echo "The pheonix instance will be local so you can debug."
@$(MAKE) clean
@$(MAKE) build-containers-local
@$(MAKE) compose-containers-local
@$(MAKE) run-local-phoenix
local-db-only:
@$(MAKE) clean
@$(MAKE) build-containers-local
@$(MAKE) compose-containers-local
build-containers:
@echo "Build all the containers in sequence."
@$(MAKE) postgres
@$(MAKE) phoenix
@$(MAKE) nginx
@$(MAKE) varnish
build-containers-local:
@echo "Build just the needed local containers for phoenix dev."
@$(MAKE) postgres
compose-containers:
docker-compose --profile all-containers -f docker-compose.yml up -d
compose-containers-local:
DOCKER_COMPOSE_NETWORK=default docker-compose --profile local-dev -f docker-compose.yml up -d
run-local-phoenix:
# Ensure the local instance of the phoneix serve is killed before starting a new one.
@$(MAKE) stop-phoenix-server
mix ecto.create
mix ecto.migrate
iex -S mix phx.server
postgres:
@echo "We are building the postgres container."
docker build -t postgres -f dockerfile-postgres .
phoenix:
@echo "We are building the phoenix elixir container."
docker build -t phoenix -f dockerfile-phoenix .
nginx:
@echo "We are building the nginx container."
docker build -t nginx -f dockerfile-nginx .
varnish:
@echo "We are building the varnish container."
docker build -t varnish -f dockerfile-varnish .
clean:
@echo "Bring docker down and delete all docker images in prep for new build."
docker-compose down --rmi local
docker image prune -f
stop-phoenix-server:
lsof -i tcp:4000 | awk 'FNR == 2 {print $$2}' | xargs kill