Nextcloud-FPM with Caddy doesn't work on docker-compose installation

Hi at everyone, my situation is that:
In a docker-compose, i have installed Home Assistant that is working fine, using Caddy with a reverse-proxy to it and SSL encryption.
I now want to install Nextcloud-FPM (with MariaDB) on a docker-compose file, using the same Caddyfile for home assistant as a webserver.
I have configured it using indications in other threads such as:

and this:
https://caddy.community/t/example-docker-nextcloud-fpm-caddy-v2-webserver/9407

However, when i put the external link to the subdomain on a browser i can’t see any page

my docker-compose.yaml

version: '3'
services:
  home-assistant:
    container_name: home-assistant
    image: homeassistant/raspberrypi4-homeassistant:stable
    volumes:
      - /home/ubuntu/homeassistant:/config
    environment:
      - TZ=Europe/Rome
    network_mode: host
    restart: always
  duckdns:
    container_name: duckdns
    image: ghcr.io/linuxserver/duckdns
    volumes:
      - /home/ubuntu/duckdns:/config
    environment:
      - "TZ=Europe/Rome"
      - "SUBDOMAINS=cloud,domotica"
      - "TOKEN=*******************************************"
    restart: always
  caddy:
    container_name: caddy
    image: caddy:latest
    volumes:
      - "/home/ubuntu/caddy/Caddyfile:/etc/caddy/Caddyfile"
      - "/home/ubuntu/caddy/data:/data"
      - "/home/ubuntu/nextcloud/var/html/data:/var/www/html/data"
      - "/home/ubuntu/nextcloud/var/www/html:/var/www/html"
    environment:
      - "TZ=Europe/Rome"
    restart: always
    ports:
      - "80:80"
      - "443:443"
  nextcloud-db:
    image: mariadb
    container_name: nextcloud-mariadb
    restart: always
    volumes:
      - "/home/ubuntu/mariadb/db:/var/lib/mysql"
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - MYSQL_ROOT_PASSWORD=************
      - MYSQL_PASSWORD=************
      - MYSQL_DATABASE=nextcloud-db
      - MYSQL_USER=nextclouduser
  nextcloud:
    container_name: nextcloud
    image: nextcloud:stable-fpm
    restart: always
    volumes:
      - "/home/ubuntu/nextcloud/var/html/data:/var/www/html/data"
      - "/home/ubuntu/nextcloud/var/www/html:/var/www/html"
      - "/home/ubuntu/nextcloud/var/www/html/config:/var/www/html/config"
      - "/home/ubuntu/nextcloud/etc/www-custom.ini:/usr/local/etc/php-fpm.d/zz.>
      - "/home/ubuntu/nextcloud/var/www/html/custom_apps:/var/www/html/custom_a>
    environment:
      - NEXTCLOUD_TRUSTED_DOMAINS=cloud.duckdns.org
      - NEXTCLOUD_ADMIN_USER=Daniel
      - NEXTCLOUD_ADMIN_PASSWORD=***********

my Caddyfile:

(https_header) {
  header {
    Strict-Transport-Security "max-age=31536000; includeSubdomains"
    X-XSS-Protection "1; mode=block"
    X-Content-Type-Options "nosniff"
    X-Frame-Options "SAMEORIGIN"
    Referrer-Policy "same-origin"
  }
}

https://domotica.duckdns.org {
  reverse_proxy http://192.168.2.30:8123
}

https://cloud.duckdns.org {

        root    * /var/www/html
        file_server

        php_fastcgi app:9000
        header {
                # enable HSTS
                # Strict-Transport-Security max-age=31536000;
        }

        redir /.well-known/carddav /remote.php/dav 301
        redir /.well-known/caldav /remote.php/dav 301

        # .htaccess / data / config / ... shouldn't be accessible from outside
        @forbidden {
                path    /.htaccess
                path    /data/*
                path    /config/*
                path    /db_structure
                path    /.xml
                path    /README
                path    /3rdparty/*
                path    /lib/*
                path    /templates/*
                path    /occ
                path    /console.php
        }

        respond @forbidden 404


}