Merge branch 'master' of git.clinicalfuture.com:arvados
[arvados.git] / docker / Makefile
1 all: api docserver workbench warehouse
2
3 # ============================================================
4 # The main Arvados servers: api, docserver, workbench, warehouse
5
6 api: .built-api
7
8 .built-api: base $(API_DEPS)
9         docker build -t arvados/api api && touch .built-api
10
11 docserver: .built-docserver
12
13 .built-docserver: base $(DOCSERVER_DEPS) 
14         docker build -t arvados/docserver docserver && touch .built-docserver
15
16 workbench: .built-workbench
17
18 .built-workbench: base $(WORKBENCH_DEPS)
19         docker build -t arvados/workbench workbench && touch .built-workbench
20
21 warehouse: .built-warehouse
22
23 .built-warehouse: base $(WAREHOUSE_DEPS)
24         docker build -t arvados/warehouse warehouse && touch .built-warehouse
25
26 # ============================================================
27 # The arvados/base image is the base Debian image plus packages
28 # that are dependencies for every Arvados service.
29
30 base:   .built-base
31
32 .built-base:    debian
33         docker build -t arvados/base base && touch .built-base
34
35 debian:         .built-debian
36
37 .built-debian:
38         ./mkimage-debootstrap.sh arvados/debian wheezy http://debian.lcs.mit.edu/debian/ \
39         && touch .built-debian
40
41 # ============================================================
42 # Dependencies for */generated files which are prerequisites
43 # for building docker images.
44
45 API_DEPS = api/generated/api.tar.gz $(API_GENERATED)
46
47 DOCSERVER_DEPS = docserver/generated/doc.tar.gz docserver/apache2_vhost
48
49 WORKBENCH_DEPS = workbench/generated/workbench.tar.gz \
50                  workbench/passenger.conf \
51                  $(WORKBENCH_GENERATED)
52
53 WAREHOUSE_DEPS = warehouse/generated/warehouse.tar.gz \
54                  warehouse/supervisor.conf \
55                  $(WAREHOUSE_GENERATED)
56
57 API_GENERATED = \
58         api/generated/apache2_vhost \
59         api/generated/config_databases.sh \
60         api/generated/database.yml \
61         api/generated/omniauth.rb \
62         api/generated/production.rb \
63         api/generated/secret_token.rb
64
65 API_GENERATED_IN = \
66         api/apache2_vhost.in \
67         api/config_databases.sh.in \
68         api/database.yml.in \
69         api/omniauth.rb.in \
70         api/production.rb.in \
71         api/secret_token.rb.in
72
73 WORKBENCH_GENERATED = \
74         workbench/generated/apache_vhost \
75         workbench/generated/production.rb \
76         workbench/generated/secret_token.rb
77
78 WORKBENCH_GENERATED_IN = \
79         workbench/apache_vhost.in \
80         workbench/production.rb.in \
81         workbench/secret_token.rb.in
82
83 WAREHOUSE_GENERATED = warehouse/generated/warehouse.conf
84
85 WAREHOUSE_GENERATED_IN = warehouse/warehouse.conf.in
86
87 api/generated/api.tar.gz:
88         tar -c -z -f api/generated/api.tar.gz -C ../services api
89
90 docserver/generated/doc.tar.gz:
91         tar -c -z -f docserver/generated/doc.tar.gz -C .. doc
92
93 workbench/generated/workbench.tar.gz:
94         tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench
95
96 warehouse/generated/warehouse.tar.gz:
97         tar -c -z -f warehouse/generated/warehouse.tar.gz -C ../.. warehouse-apps
98 $(API_GENERATED): $(API_GENERATED_IN)
99         ./config.rb
100
101 $(WORKBENCH_GENERATED): $(WORKBENCH_GENERATED_IN)
102         ./config.rb
103
104 $(WAREHOUSE_GENERATED): $(WAREHOUSE_GENERATED_IN)
105         ./config.rb