In your compose file, in ports, just set the first number to the port number you wanna use. I use 8088 for my nextcloud for instance. The second number is the number the docker container is set to use internally. So you can just set like 8088:80 in your compose file. That should do the trick.
Sounds great!
Can you provide your compose-file? I feel like I need a correct and up-to-date setup to properly understand it.
Is PiHole, Unbound and NextCloud running in the same compose file and are you using different networks in it?
Actually I don't have unbound and runs directly in my pi2 so I just have a nextcloud in a compose file that's been running for 3 years. But the issue seems to be with docker port mapping. You just have to remember to use different port mapping to the same 80 port they need and you should be good.
I use this community maintained version, they have a very detailed description and an example compose: https://github.com/nextcloud/docker#base-version---apache
Would a reverse proxy be a solution? I haven't done that type of thing in a while but maybe you could map different services to different subdomains and just route that way?
Toss a reverse proxy in front like Traefik and that way any docker container can overlap however it wants.
One of the traditional ways to do this is to stand up a reverse proxy (e.g. NGinx) That then sits on ports 80 and 443 (you'll want TLS for NextCloud) and forwards traffic to those applications. If you are using docker for everything, you can have a back-end docker network where the NGinx container forwards traffic to the PiHole and NextCloud containers. And since each container is its own entity, you don't need to worry about mucking about with the ports for the different services, they can each have ports 80/443 on their own container and you don't need to worry about forwarding those ports from the host. Though, if PiHole is running on the hardware and not in a container, this can complicate things.
A fronting web server acting as a reverse proxy is the solution to this. In the current landscape I would look into Traefik, it has integration with docker allowing it to discover the correct backend servers.
With this solution you do not need to expose port 80/443 from the other containers at all, rather you’d expose the ports from the Traefik container which will read the request header and sent it to the correct container based on hostname. This means that you might need to setup DNS and point hostnames to your server if you haven’t already.
Docker