Can you exec to your caddy container and see if you can resolve the name nextcloud-aio-apache?
nextcloud-aio-apache