flightstats / hub

fault tolerant, highly available service for data storage and distribution
http://www.flightstats.com
MIT License
103 stars 35 forks source link

Single hub needs a way to identify its external host/port info #1028

Open Exide opened 6 years ago

Exide commented 6 years ago

Given this configuration (defaults and what our CI uses):

app.url = http://localhost/
http.bind_port = 80
rzander@host$ docker ps -a
CONTAINER ID        IMAGE                    COMMAND                  CREATED          STATUS           PORTS                  NAMES
d20dd74beced        flightstats/hub:latest   "/bin/bash /opt/hu..."   1 second ago     Up 1 second      0.0.0.0:8081->80/tcp   hub
root@container$ hostname
d20dd74beced

What we get from the current helper methods is this:

However what we need is either of these:

http://127.0.0.1:8081
http://localhost:8081