-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontainer.yml
163 lines (162 loc) · 4.09 KB
/
container.yml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
version: "2"
settings:
conductor:
base: ubuntu:xenial
# roles_path: # Specify a local path containing Ansible roles
# volumes: # Provide a list of volumes to mount
# environment: # List or mapping of environment variables
project_name: drastic-cluster
# The deployment_output_path is mounted to the Conductor container, and the
# `run` and `deployment` commands then write generated Ansible playbooks to it.
# deployment_output_path: ./ansible-deployment
defaults:
deploy_local_code: no
https_mode: no
django_host: django
http_port: 8080
https_port: 8443
gunicorn_workers: 3
install_dir: /opt/drastic
cassandra_replication_factor: 2
cassandra_seed_server: cassandra-1
cassandra_hosts:
- cassandra-1
- cassandra-2
- cassandra-3
services:
djangoinit:
from: ubuntu:xenial
roles:
- drastic
- django
environment:
DJANGO_STATIC_ROOT: "/static"
CASSANDRA_SEED_SERVER: "{{ cassandra_seed_server }}"
CASSANDRA_HOSTNAMES: "{{ cassandra_hosts|join(',') }}"
CASSANDRA_REPLICATION_FACTOR: "{{ cassandra_replication_factor }}"
CASSANDRA_CONSISTENCY_LEVEL: "{{ cassandra_hosts|length - cassandra_replication_factor + 1 }}"
command: "{{ install_dir }}/django_init.sh"
entrypoint: "{{ install_dir }}/entrypoint.sh"
links:
- mosquitto
- cassandra-1
- cassandra-2
- cassandra-3
depends_on:
- cassandra-1
- cassandra-2
- cassandra-3
volumes:
- static-content:/static
- logs:/logs
django:
from: ubuntu:xenial
roles:
- drastic
- django
expose:
- 8000
dev_overrides:
ports:
- 8888:8000
environment:
DJANGO_STATIC_ROOT: "/static"
CASSANDRA_SEED_SERVER: "{{ cassandra_seed_server }}"
CASSANDRA_HOSTNAMES: "{{ cassandra_hosts|join(',') }}"
CASSANDRA_REPLICATION_FACTOR: "{{ cassandra_replication_factor }}"
CASSANDRA_CONSISTENCY_LEVEL: "{{ cassandra_hosts|length - cassandra_replication_factor + 1 }}"
GUNICORN_CMD_ARGS: |
--workers {{ gunicorn_workers }}
--forwarded-allow-ips '*'
--bind "0.0.0.0:8000"
--pythonpath '{{ install_dir }}/web/project'
--config '{{ install_dir }}/web/project/gunicorn.conf'
--log-file '/logs/drastic-web-gunicorn.log'
--log-level INFO
--timeout 300
command: "{{ install_dir }}/web/bin/gunicorn drastic_ui.wsgi"
entrypoint: "{{ install_dir }}/entrypoint.sh"
restart: on-failure
depends_on:
- djangoinit
- mosquitto
- cassandra-1
- cassandra-2
- cassandra-3
links:
- mosquitto
- cassandra-1
- cassandra-2
- cassandra-3
volumes:
- static-content:/static
- logs:/logs
nginx:
from: nginx
roles:
- nginx
command: "nginx -g 'daemon off;'"
ports:
- 80:8080
- 443:8443
dev_overrides:
ports:
- 8080:8080
- 8443:8443
links:
- django
volumes:
- static-content:/static
- logs:/logs
mosquitto:
from: eclipse-mosquitto
expose:
- 1883
- 9001
#volumes:
# - mosquitto.conf:/mosquitto/config/mosquitto.conf
cassandra-1:
from: cassandra
environment:
CASSANDRA_BROADCAST_ADDRESS: cassandra-1
volumes:
- volume1:/var/lib/cassandra
restart: on-failure
cassandra-2:
from: cassandra
environment:
CASSANDRA_BROADCAST_ADDRESS: cassandra-2
CASSANDRA_SEEDS: cassandra-1
depends_on:
- cassandra-1
volumes:
- volume2:/var/lib/cassandra
restart: on-failure
cassandra-3:
from: cassandra
environment:
CASSANDRA_BROADCAST_ADDRESS: cassandra-3
CASSANDRA_SEEDS: cassandra-1
depends_on:
- cassandra-2
volumes:
- volume3:/var/lib/cassandra
restart: on-failure
registries: {}
volumes:
static-content:
docker: {}
logs:
docker: {}
volume1:
docker: {}
external:
name: cassandra1-vol
volume2:
docker: {}
external:
name: cassandra2-vol
volume3:
docker: {}
external:
name: cassandra3-vol