Unable to update trusted domains of owncloud in docker-compose

Steps to reproduce

  1. Install owncloud using guide on owncloud website for docker (Can not include the link here for some reason)
  2. Change “OWNCLOUD_TRUSTED_DOMAINS” in .env or compose.yml file
  3. Recreate owncloud container

Expected behaviour

config.php file should change and include the new trusted domains

Actual behaviour

config.php stays the same

Server configuration

Operating system:
ubuntu 24.04
Web server:
internal of docker compose file (according the guide above)
Database:
internal of docker compose file (according the guide above)
PHP version:
internal of docker compose file (according the guide above)
ownCloud version: (see ownCloud admin page)
10.15.0
Updated from an older ownCloud or fresh install:
Migrated from 10.11
Where did you install ownCloud from:
docker compose by using the official docker installations on owncloud website . (Can not include the link here for some reason)

I am trying to update the owncloud trusted domains on owncloud server 10.15.0 running on ubuntu 24.04 using docker. I installed and configure owncloud using the official docker installation guide in owncloud website and it is running just fine for now.

When I try to update the environmental variables either in .env or compose.yml file and recreated the container the config.php is not being updated and stays the same. If i delete it and recreate the container config.php is simply being re-created using the old values (values I put during the first installation) it is simply ignoring the new values added in compose.yml or .env files.

Is there a way to force the change to owncloud config.php so I can include more trusted domains?