Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions bin/manager/containerpilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@ def load(self, envs=os.environ):
cfg = cfg.replace('}{{ end }}', '}')
config = json.loads(cfg)

consul = env('CONSUL', 'consul', envs, fn='{}:8500'.format)

if env('CONSUL_AGENT', False, envs, to_flag):
config['consul'] = 'localhost:8500'
cmd = config['coprocesses'][0]['command']
host_cfg_idx = cmd.index('-retry-join') + 1
cmd[host_cfg_idx] = consul
cmd[host_cfg_idx] = env('CONSUL', 'consul', envs)
config['coprocesses'][0]['command'] = cmd
else:
config['consul'] = consul
config['consul'] = env('CONSUL', 'consul', envs,
fn='{}:8500'.format)
config['coprocesses'] = []

self.config = config
Expand Down
12 changes: 4 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ mysql:
environment:
- CONTAINERPILOT=file:///etc/containerpilot.json
- CONSUL_AGENT=1
- LOG_LEVEL
- LOG_LEVEL=INFO

consul:
image: autopilotpattern/consul:0.7r0.7
command: >-
/usr/local/bin/containerpilot
/bin/consul agent -server
-bootstrap-expect 1
-config-dir=/etc/consul
-ui-dir /ui
image: consul:0.7.1
command: >
agent -server -client=0.0.0.0 -bootstrap -ui

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well isn't that clean?

restart: always
mem_limit: 128m
ports:
Expand Down