/
Azkfile.js
131 lines (131 loc) · 3.76 KB
/
Azkfile.js
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
systems({
'web': {
depends: ['db', 'memcached', 'redis'],
image: {'docker': 'azukiapp/node:5'},
provision: [
'npm install'
],
workdir: '/azk/#{manifest.dir}',
shell: '/bin/bash',
command: "node --use_strict src/web/web.js",
wait: 20,
mounts: {
'/azk/#{manifest.dir}': sync('.'),
'/azk/#{manifest.dir}/node_modules': persistent('./node_modules'),
},
scalable: {'default': 1},
http: {
domains: ['#{manifest.dir}-#{system.name}.#{azk.default_domain}']
},
ports: {
http: '2708/tcp'
},
envs: {
NODE_ENV: 'dev',
PORT: '2708',
},
},
'collector': {
depends: ['redis'],
image: {'docker': 'azukiapp/node:5'},
provision: [
'npm install'
],
workdir: '/azk/#{manifest.dir}',
shell: '/bin/bash',
command: "node --use_strict src/collector/collector.js",
wait: 20,
mounts: {
'/azk/#{manifest.dir}': sync('.'),
'/azk/#{manifest.dir}/node_modules': persistent('./node_modules'),
},
scalable: {'default': 1},
envs: {
NODE_ENV: 'dev',
},
},
'processor': {
depends: ['redis', 'db'],
image: {'docker': 'azukiapp/node:5'},
provision: [
'npm install'
],
workdir: '/azk/#{manifest.dir}',
shell: '/bin/bash',
command: "node --use_strict src/processor/processor.js",
wait: 20,
mounts: {
'/azk/#{manifest.dir}': sync('.'),
'/azk/#{manifest.dir}/node_modules': persistent('./node_modules'),
},
scalable: {'default': 1},
envs: {
NODE_ENV: 'dev',
},
},
'prefetch': {
depends: ['redis', 'db', 'memcached'],
image: {'docker': 'azukiapp/node:5'},
provision: [
'npm install'
],
workdir: '/azk/#{manifest.dir}',
shell: '/bin/bash',
command: "node --use_strict src/prefetch/prefetch.js",
wait: 20,
mounts: {
'/azk/#{manifest.dir}': sync('.'),
'/azk/#{manifest.dir}/node_modules': persistent('./node_modules'),
},
scalable: {'default': 1},
envs: {
NODE_ENV: 'dev',
},
},
'db': {
image: {'docker': 'azukiapp/mongodb'},
scalable: false,
wait: {'retry': 20, 'timeout': 1000},
mounts: {
'/data/db': persistent('mongodb-#{manifest.dir}'),
},
ports: {
http: '28017:28017/tcp',
},
http: {
domains: ['#{manifest.dir}-#{system.name}.#{azk.default_domain}'],
},
export_envs: {
MONGODB_URI: 'mongodb://#{net.host}:#{net.port[27017]}/#{manifest.dir}_development'
},
},
'memcached': {
image: {'docker': 'memcached'},
scalable: false,
wait: {'retry': 20, 'timeout': 1000},
ports: {
http: '11211:11211/tcp'
},
http: {
domains: ['#{manifest.dir}-#{system.name}.#{azk.default_domain}']
},
export_envs: {
MEMCACHED_HOST: '#{net.host}',
MEMCACHED_PORT: '#{net.port[11211]}'
}
},
'redis': {
image: { docker: 'redis' },
ports: {
http: '6379:6379/tcp'
},
http: {
domains: ['#{manifest.dir}-#{system.name}.#{azk.default_domain}']
},
export_envs: {
REDIS_URL: 'redis://#{manifest.dir}-#{system.name}.#{azk.default_domain}:#{net.port[6379]}',
REDIS_HOST: '#{net.host}',
REDIS_PORT: '#{net.port[6379]}'
}
}
});