possibility to set other internal ports than 80
maxfriedmann opened this issue · 15 comments
Hi,
this proxy works just fine for most of my applications. Now we also want to deploy applications like atlassian jira within this proxy, where we don't have the possibility to set the internal ports, e.g. confluence runs on port 8090.
It would be very useful to have a VIRTUAL_PORT environment variable as well.
Hi @maxfriedmann, I will investigate this and come up with a PR
@maxfriedmann I haven't forgot about this, I'm in the process of refactoring the hole thing. I plan to support this as part of that.
I would love to contribute, but writing dockerfiles isn't one of my skills (yet)...
any news on this?
@maxfriedmann Sorry I've been super busy with projects, Im going to try and get some more done this week, check back next week for a PR to test.
I too would much like to see this improvement. @madwire have you begun work on this? If so, I'd be eager to see how far you've gotten and possibly finish it.
@Telling Hello, I have begun working on this but unfortunately other project work has taken up a lot of my time. The solution is a little complex as it has some performance issues. Right now finding docker cloud services that run on port 80 or 443 is easy (and cheap) via the API. Having a per service port number means I need another way to identify the services via an environment variable, but that means I have to load every single service including DB's (for example) environments which is costly (the more you have).
Basically it's on the TODO list, just haven't got to it yet. Sorry
I thought you are doing that anyway right now. How else can you figure out if "VIRTUAL_HOST" is exported? The same way, when a new instance boots up, you could check "VIRTUAL_PORT" or something?
@maxfriedmann I'm using the port export option which gives me a port type option (http or https) via the API, this is on the service level. So this happens before I have the containers. So VIRTUAL_HOST doesn't come into it.
One option I'm exploring is that you have to export on port 80 still but provide a VIRTUAL_PORT which is used instead. Would this be an option?
@maxfriedmann @Telling I have created a PR for this, but you must still export on port 80 for your service to be classed as an HTTP service. Hope this is clear.
If you could test this, and let me know how it goes I can then merge it into master.
@madwire thanks, I will give it a spin tomorrow or the day after, and report back.
For my scenario that won't work since I am booting e.g. Atlassian Jira as Docker Image which exposes a port like 8889. I can't (and I don't want to) change that image.
@maxfriedmann Will something like this not work?
my-app:
environment:
- VIRTUAL_HOST=example.com www.example.com
- VIRTUAL_PORT=8889
expose:
- '80'
- '8889'
image: 'my_image:latest'
Nothing has to be listening on port 80, its just used to announce that it has a http(s) service.
@madwire, since am already working with stack files this seems a bit of an overhead, but it works :)