-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
152 lines (136 loc) · 3.2 KB
/
docker-compose.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
version: '3.7'
x-nomad: &x-nomad |
{
"server": {
"enabled": true,
"bootstrap_expect": 1
},
"datacenter": "city",
"data_dir": "/tmp/nomad/data/",
"bind_addr": "0.0.0.0",
"advertise": {
"http": "nomad:4646",
"rpc": "nomad:4647",
"serf": "nomad:4648"
},
"enable_debug": true
}
services:
db:
image: postgres:10.5
volumes:
- postgres:/var/lib/postgres
ports:
- "5432:5432"
redis:
image: redis:4
command: redis-server --daemonize no
default: &default
build:
context: .
args:
- APP_NAME=userland
image: box
environment:
- DATABASE_URL=postgres@db:5432
- CONSUL_HOST=consul
- SEA_HOST=${SEA_HOST}
- FLASK_APP=${FLASK_APP}
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- .:/userland
links:
- nomad
depends_on:
- db
- consul
- nomad
- redis
- mail
- jobs
stripe:
image: stripemock/stripe-mock
ports:
- "12111:12111"
jump:
image: cypherpunkarmory/box:develop
volumes:
- ${SSH_KEY}:/home/userland/.ssh/authorized_keys
entrypoint: bash -l -c 'chown userland:userland /home/userland/.ssh/authorized_keys && chmod 600 /home/userland/.ssh/authorized_keys && /usr/sbin/sshd -D'
ports:
- "3122:22"
mail:
image: mailhog/mailhog
ports:
- "1025:1025"
- "8025:8025"
web:
<<: *default
command: bash -l -c 'python -m flask run -h 0.0.0.0'
ports:
- "5000:5000"
- "4444:4444"
jobs-dash:
<<: *default
environment:
- DATABASE_URL=postgres@db:5432
- RQ_REDIS_URL=redis://redis:6379
- RQ_DASHBOARD_REDIS_URL=redis://redis:6379
command: bash -l -c 'rq-dashboard -b 0.0.0.0'
ports:
- "9181:9181"
jobs:
<<: *default
volumes:
- .:/userland
command: bash -l -c 'python -m flask rq worker'
ports:
- "4442:4442"
depends_on:
- redis
scheduler:
<<: *default
command: python -m flask rq scheduler
depends_on:
- jobs
volumes:
- .:/userland
consul:
image: consul
ports:
- "8500:8500"
command: agent -data-dir=/consul/data -config-dir=/consul/config -dev -client 0.0.0.0 -log-level=INFO
nomad:
image: cypherpunkarmory/local-nomad:develop
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
environment:
NOMAD_DATA_DIR: /tmp/nomad/data
NOMAD_RUN_ROOT: 1
NOMAD_ADDR: http://nomad:4646
NOMAD_LOCAL_CONFIG: *x-nomad
ports:
- "4646:4646"
volumes:
- "/tmp:/tmp"
- "/tmp/nomad/data:/tmp/nomad/data"
- "./local_ssh.hcl:/box.hcl"
- "/var/run/docker.sock:/var/run/docker.sock"
command: agent -dev -bind=0.0.0.0 -consul-address=consul:8500 -consul-auto-advertise=0
fabio:
image: fabiolb/fabio:1.5.10-go1.11.1
environment:
- FABIO_LOG_LEVEL=DEBUG
- FABIO_REGISTRY_CONSUL_ADDR=consul:8500
- FABIO_PROXY_ADDR=:9999;proto=http,:9991;proto=tcp+sni
links:
- consul
ports:
- "9998:9998" # GUI/management
- "80:9999" # HTTP exposed
- "443:9991" # HTTP exposed
volumes:
postgres:
userland: