Please, I would ask for your help even if this is not a genuine Nextcloud AIO problem but more of a understanding Docker problem on my side.
For quite some time, everything was working perfectly fine. Nginx PM in his macvlan pointing at nextcloud-aio-apache:11000.
Suddenly after an update of Nextcloud, Nginx PM or Docker, I don’t know what caused that, Nginx PM was not able to resolve the hostname “nextcloud-aio-apache” any more (nginx pm error log). I tried an external Caddy container and the same problem.
So I started digging, I am no Docker expert but I know the basics (I hope). The network “nextcloud-aio” was already in the Nginx PM compose file at the bottom as external, but somehow not “connected” to the container.
I added it to the networks section of the service and everything seemed to work again until I had to redeploy/recreate the Nginx PM container. The container would not start and complained about an already exposed port 80. I restarted the container and everything worked fine again. But after an server reboot or an recreate after an update the same problem again.
I assigned the port 80 and port 443 of the Nginx PM directly to the macvlan interface ip addr. But still, then I get the following error message if I recreate the container. If I restart the container after the container already exists, no error and everything works again.
Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint nginx-proxy-manager (189e2123699b8b7444c4a251f0096317ebd3234903870aefe76955fc60d3eb0c): failed to bind host port 192.168.178.35:80/tcp: cannot assign requested address
My Nginx PM compose file:
services:
nginxpm:
image: 'jc21/nginx-proxy-manager:latest'
container_name: nginx-proxy-manager
restart: unless-stopped
networks:
nginxpm-network:
ipv4_address: ${NGINXPM_IP4_ADDR} #Change, your nginx-pm ip-address (macvlan)
mac_address: xx:xx:xx:xx:xx:xx # your mac address (von Fritzbox übernommen, nach erstem Start)
nextcloud-aio:
ports:
# These ports are in format <host-port>:<container-port>
- '${NGINXPM_IP4_ADDR}:80:80' # Public HTTP Port
- '${NGINXPM_IP4_ADDR}:443:443' # Public HTTPS Port
- '${NGINXPM_IP4_ADDR}:81:81' # Admin Web Port
# Add any other Stream port you want to expose
# - '21:21' # FTP
# Uncomment the next line if you uncomment anything in the section
# environment:
# Uncomment this if you want to change the location of
# the SQLite DB file within the container
# DB_SQLITE_FILE: "/data/database.sqlite"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ${APPDATA}/nginx-proxy-manager/data:/data
- ${APPDATA}/nginx-proxy-manager/letsencrypt:/etc/letsencrypt
networks:
nginxpm-network:
name: macvlan # network name of your macvlan network
external: true
nextcloud-aio:
name: nextcloud-aio
external: true
What am I doing wrong?
If I remove the interface ip addr in front of the port mappings, I will occasionally get an error message that port 80 was already assigned (I have not been able to reproduce this error today).
Any advice would be very much appreciated. Thank you!