Skip to content

Commit 5535aad

Browse files
committed
Update "containerpilot.json" to assume "consul" if "CONSUL" is unset
This mimics the behavior of the Python code: bin/manage.py:19:consul = pyconsul.Consul(host=os.environ.get('CONSUL', 'consul')) This allows us to remove `CONSUL=consul` from the Compose files, thus allowing for local deploys to assume the correct value, and Triton deploys to use CNS via `_env` to set `CONSUL=...` to an appropriate value.
1 parent a862b1d commit 5535aad

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

etc/containerpilot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"consul": "{{ .CONSUL }}:8500",
2+
"consul": "{{ if .CONSUL }}{{ .CONSUL }}{{ else }}consul{{ end }}:8500",
33
"preStart": "python /usr/local/bin/manage.py",
44
"preStop": "python /usr/local/bin/manage.py pre_stop",
55
"services": [

local-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ services:
77
mem_limit: 512m
88
build: .
99
env_file: _env
10-
environment:
11-
- CONSUL=consul
1210
ports:
1311
- 27017
1412

0 commit comments

Comments
 (0)