I canât for the life of me work out my Nextcloud will not work when it assigned to a custom docker network. I want to have it be able to connect to my MariaDB container without having to open a port and use the host IP.
If I just leave it connected to the default network and set
MYSQL_HOST=192.168.0.10:3306
it works, but if I add it to the custom docker network I am using
networks:
- t2_proxy
so I can use MYSQL_HOST=mariadb, like I do with every other one of my services, I canât access Nextcloud, and there are no errors in the docker log so I have no idea why it doesnât work.
I already have a working Nextcloud install but it uses the Linuxserver image, and they replaced Apache with NGINX, but I would rather use the official image if possible.
Welcome to the wonderful world of Nextcloud and itâs amazing community.
Your question is more about Docker networking rather Nextcloud. Please familiarize yourself with the the technology. Especially if you you docker compose (and would recommend to) you get âfreeâ application network for every compose file. all containers defined in one compose file can access each other by just using service: name or optionalcontainer_name:Networking in Compose | Docker Documentation.
Take a look at examples provided by Nextcloud docker developers.
common practice in containers is to send logs to STDOUT which you can consult using "docker logs <container name>"
I am already using Docker Compose. I have over 30 services working together flawlessly. I use custom networks for container isolation so that only containers that can talk to each other directly can do so. This is common docker practice.
As I said before, the official Nextcloud image works, but the only way I can get it to connect to my database container is if I map a port to the host for the mariadb container and connect via IP:Port which defeats one of the main purposes of docker. If I put Nextcloud on the same custom docker network as my database so it can refer to it by container name, it does not work.
The Linuxserver Nextcloud image works fine if used in the same way, but it does not use Apache, but Nginx instead.
Also there is no errors in the docker log for the Nextcloud container, I just canât open Nextcloud in my browser. The log output is identical to how it appears if I donât user a custom Network
Could not reliably determine the server's fully qualified domain name, using 172.29.0.3
as opposed to
Could not reliably determine the server's fully qualified domain name, using 192.168.90.10
the difference I donât assign custom network to a DB and rather use âdefaultâ network for app<->DB communication as there is no reason for me to expose the DB to any other application then Nextcloud (with additional push and cron containers skipped above for simplicity).
This setup is common and definitely works⌠please provide your docker-compose.yaml, docker network lsdocker network inspectand docker inspect and docker inspect app`
If I remove Nextcloud from the t2_proxy network, it works, but then I have to open the port for the mariadb container and connect to it by host_ip:port which I donât want to do. As soon as I add it back, it doesnât work. No errors in âdocker logs -f nextcloudâ at all, the page just doesnât load. It has to have something to do with Apache.
On default network. Nextcloud loads Could not reliably determine the server's fully qualified domain name, using 172.29.0.3
On t2_proxy network. Nextcloud doesnât work Could not reliably determine the server's fully qualified domain name, using 192.168.90.10
No issues with Linuxserverâs Nginx Nextcloud container and exactly the same setup, apart from the Photos app being busted in 26.0.1 but thatâs not their issue.
nothing wrong with it⌠but you know you donât need to put everything into one file? separating applications into different compose files makes administration on single applications far easierâŚ
absolutely right⌠default docker subnets are in 172.x.x.x range and your t2_network defines 192.186.90.0/24 rangeâŚ
based on what you posted this makes no sense⌠but unfortunately you didnât post what I asked for so no idea what are doing wrong.
Iâm sorry donât get the point - you talk all the time about DB issues and now the problem must be related to Apache? please try to describe the issue exact and post logs and error messages⌠maybe you should start telling what you mean when you say âit worksâ and what is in your eyes the error!