-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
77 lines (62 loc) · 1.43 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
69
70
71
72
73
74
75
76
77
LINKS=--link rcop-db:db --link rcop-redis:redis
PORTS=-p 8080:3000
DEV_PORTS=-p 4000:3000
APP_IMAGE="rcop-app"
APP_CONTAINER="rcop-web"
DBDATA_CONTAINER="rcop-dbdata"
DB_IMAGE="postgres:9.3"
REDIS_IMAGE="redis:2.8"
DEV_DB_URL=postgresql://db:5432/rcop_development?pool=5&user=postgres
all: development
production:
docker run -d \
--name $(APP_CONTAINER) \
$(LINKS) \
$(PORTS) \
--env-file .envfile \
$(APP_IMAGE)
run-app:
docker run -d \
--name $(APP_CONTAINER) \
$(LINKS) \
$(PORTS) \
$(APP_IMAGE)
development: build-app
docker run -i -t \
--rm \
-v `pwd`/:/refactorcop \
$(LINKS) \
$(DEV_PORTS) \
-e "DATABASE_URL=$(DEV_DB_URL)" \
$(APP_IMAGE)
debug-app:
docker run -i -t \
--rm \
-v `pwd`/:/refactorcop \
$(LINKS) \
$(DEV_PORTS) \
-e "DATABASE_URL=$(DEV_DB_URL)" \
--entrypoint "/bin/bash" \
$(APP_IMAGE)
clean-app:
docker stop $(APP_CONTAINER); docker rm $(APP_CONTAINER)
build-app:
docker build -t $(APP_IMAGE) .
clean-setup: clean-db clean-redis
setup: run-db run-redis
run-db: run-dbdata setup-db
run-dbdata:
docker run -d \
--name $(DBDATA_CONTAINER) \
--entrypoint /bin/echo \
$(DB_IMAGE) Data-only container
setup-db:
docker run -d --name "rcop-db" \
--volumes-from $(DBDATA_CONTAINER) \
$(DB_IMAGE)
clean-db:
docker stop "rcop-db"; docker rm "rcop-db"
run-redis:
docker run -d --name "rcop-redis" $(REDIS_IMAGE)
clean-redis:
docker stop "rcop-redis"; docker rm "rcop-redis"