First thanks for taking the time to look, I am new to docker, I have been using a dedicated server for years using the standard LAMP structure normally with cpanel but now using directadmin and have never really had to deal with ports and nginx, I was happy for the control panel to take care of all of that for me.
HOWEVER
I am now venturing into making mobile apps as well as websites and from what I can tell so far docker is the way to go for installing the mobile backend (supabase etc), I have installed docker on the server, that was not an issue, the issue is when I try and install things with docker and I end up with a port/dns nightmare.
So this is the total mess I seem to be in
I have the standard LAMP setup on the server with nginx installed and working, nginx is running on ports 80 and 443 and apache is 8080 and for ssl 8081 (All good)
Docker is installed (all good)
Now I want my mobile backend to be linked to a domain that is ALREADY hosted on my server under the LAMP setup, for this case we will just called it mysite.com
SO im looking to get the following setup
npm.mysite.com
(Nginx Proxy Manager)
supabase.mysite.com
(mobile backend)
As I have mysite.com
already serving a website on the LAMP setup I have gone to my DNS for the domain (I have my own name servers so all the dns is done on directadmin not my domain registrar) and I have added each of the subnames (npm, supabase) to an A record pointing to the server ip
The problem starts when I try and add containers, for example the first container I try and add is the Nginx Proxy Manager which wants to use ports 80:80
443:443
81:81
and I get the error
Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint nginx-proxy-manager (d25c18...): failed to bind host port for 0.0.0.0:80:10.0.1.2:80/tcp: address already in use
I know this is a port/dns issue but im just totally lost with ports and dns having never really used them, more web developer than server dev, I have watched countless videos over the last few days and they just have my head spinning.
for example if I change the yaml file so it uses ports 8880:80, 4443:443
instead of the standard it installs and I can goto the serverip:81
and the npm control panel is there, but then I just run into more issues trying to get ssl certs to work.
I cant get the dns to work either so npm.mysite.com
does not resolve to the serverip:81
I just see the “webserver is functioning normally” message instead of the control panel, and im sure thats because its pointing to the LAMP version of the site instead of the container.
Does anyone have any suggestions I can try, I have full access to the server, and if it helps my server comes with 5 ip addresses, 1 is being used as the main shared server ip for all the websites, 2 are being used for my name servers so I have 2 free dedicated ip addresses on the server.
Sorry about it being such a long post but I wanted to be as thorough as I was able and once again thank you for taking the time to take a look at my mess.
Kind regards
Wayne