Network config omv docker

I have a stack in which I run NC, MariaDB and swag.
When I start the stack all containers are attached to the default bridge. NC is not accessible via it’s DNS and does not work.
I have created a user bridge named nextcloud and attached all containers to this network manually. Then I am up and running!
However when I restart my stack I have to manually attach all containers to nextcloud bridge, otherwise NC will not work.
Can I attach them by default or can I use the default bridge?

Stack file:
version: “2.1”
services:
nextcloud:
image: ghcr.io/linuxserver/nextcloud
container_name: nextcloud
environment:

  • PUID=id#
  • PGID=gr#
  • TZ=Europe/Amsterdam
    volumes:
  • /srv/dev-disk-by-uuid-blabla/appdata/nextcloud/config:/config
  • /srv/dev-disk-by-uuid-blabla/appdata/nextcloud/data:/data
    depends_on:
  • mariadb
    restart: unless-stopped
    mariadb:
    image: ghcr.io/linuxserver/mariadb
    container_name: mariadb
    environment:
  • PUID=id#
  • PGID=gr#
  • MYSQL_ROOT_PASSWORD=secret
  • TZ=Europe/Amsterdam
  • MYSQL_DATABASE=nextcloud
  • MYSQL_USER=ncuser
  • MYSQL_PASSWORD=alsosecret
    volumes:
  • /srv/dev-disk-by-uuid-blabla/appdata/mariadb:/config
    restart: unless-stopped
    swag:
    image: ghcr.io/linuxserver/swag
    container_name: swag
    cap_add:
  • NET_ADMIN
    environment:
  • PUID=1001
  • PGID=100
  • TZ=Europe/Amsterdam
  • URL=my.duckdns.org
  • SUBDOMAINS=wildcard
  • VALIDATION=duckdns
  • DUCKDNSTOKEN=token
    volumes:
  • /srv/dev-disk-by-uuid-blabla/appdata/swag:/config
    ports:
  • 443:443
  • 80:80
    restart: unless-stopped

After days of googling I finally discovered that when launching the yaml file in Portainer, no custom bridge is created. When I copy paste the code in a separate file an do a docker compose up -d , a custom network is created and containers are attached to this network.
Why this NOT the case in Portainer I do not understand??
My problem is solved (launch the stack via CLI), but I am still left with a question