Mapping port 80:7575
I have a goal of reaching my dashboard via dashboard.mydomain.com from within my LAN. Using portainer, I've configured and created a macvlan and updated the Homarr stack to use that network. The container is now happily running on its own reserved IP at 192.168.1.160 and I'm able to reach the dashboard at http://homarr.mydomain.com:7575.
The next step, which I expected to be simple, was to have :80 on that IP forward to :7575 so that I'd have a nice tight path to the dashboard at http://homarr.mydomain.com, but that's not working out so well for me. Does anyone happen to see what I'm missing in my stack definition?
Solution:Jump to solution
💥 http://homarr.mydomain.com/board is now live!
```
version: '3'
#---------------------------------------------------------------------#
Homarr - A simple, yet powerful dashboard for your server. #...
25 Replies
Can you temporarily try a different second port?
This will let us know it it's an issue with using 2 ports, or port 80 in particular.
@robwilkerson you cannot and shouldn't map the same port to two exposed ports on the bridge. It's a terrible idea and prone to failure. Please remove 7575.
Tried that originally as a flier with no success, but I take your point
This doesn't work either. Will keep plugging away.
Is the lan network really working as intended? Do you run other containers with the same configuration as well?
Why not just use bridge? Do you need special routing?
I wanted key containers to have their own ip so I don’t have to remember all of the various ports
Okay. Do you the same for other containers?
This is my first attempt. The dashboard is the key-est web interface.
I have a similar goal of using port 80 and setting up A records in my AD DNS, but running Homarr on port 80 was problematic. I use bridge on all other containers and port 80, but Homarr gets flakey. So for now staying with port 7575 keeps it working until I find a solution.
The ip is working properly, just not the custom port mapping yet.
I really don't get what would be flakey. We do nothing special in the Dockerfile. Can you elaborate what "flakey" means? Does it disconnect sometimes? Certificate errors?
Yeah, flakey wasn’t the best wording. It’s been a couple weeks since I messed with it, but the main page wouldn’t load up when port was set to 80. I tried different browsers, on LAN mobile devices, FQDN and IP. Finally just punted and changed back to 7575 and figured I would tackle it again sometime. On other containers I can set the port number without issue, but this one seems like it’s baked in.
Yeah, this def feels odd. I assume that homarr's dockerfile exposes :7575 and the application listens on that port. It doesn't seem like it should care which port I map forward from the host, but that said, this is all within portainer on a synology nas, all of which I'm also still getting my head around so...lots of stuff in play that maybe I don't yet understand fully enough.
Can you try setting the PORT environment variable? Does it help?
I see that it's currently set to 7575, so I assumed that was to tell the application where to listen, but yeah, I can try to set that manually.
Solution
This also allows me to remove the port mapping all together since it's not running locally as far as my LAN is concerned. Exactly where I was hoping to land.
Oh, so using the network probably removes the requirement for port mapping? Sorry, I don't use network that often myself....
Follow on question about the networking of the dashboard. I have an app linking to my NAS web interface and one to my Portainer interface. Both work fine when I click on them, but the status icon indicates that they're unreachable:
EHOSTUNREACH 192.168.1.25:XXXX
What's the nature of the difference in behavior?Yeah, I'm kind of sorting this out myself, but it makes sense to me that if the container runs as an independent host on my network and the app runs on :80 on that independent host, i wouldn't need to map ports on my host.
It means that the container can't read it. Try pinging from the container with ping, wget or curl.
We cannot help that much since it depends on your network configuration.
ok, so this is a side effect that I'll need to sort out. thanks for your help!
No worries, glad that it works now. Enjoy Homarr
I’ll try using uppercase for environment PORT and see if that makes a difference. I’m new to containers as well, seems there are idiosyncrasies to learn
Would it not be a better option to put a reverse proxy (something like Nginx) in the loop? I have Homarr running as a container on an Ubuntu VM (using Portainer) on the standard port. I also have Nginx running on a seperate vm. This means I am only exposing standard http ports (mainly 443 for Https) to the internet and then the internal port is routed via Nginx to the Homarr container on the standard port.
I am not an expert by any means, but its not overly complicated to setup. I pay for my own domain and use LetsEncrypt for https certification.
Also means you can then make other elements accessible externally if you want to, but it all comes into your home IP on the same http/https port and just routed internally to where it needs to go/
Yeah, I could do that as well, and may yet have to, but was hoping to avoid more containers. In this case, the complexity of fewer containers is starting to look worse than the complexity of more containers. So...yeah. 😄