I think you have that envvar set correctly, but the guide also says that you need to set WEBPASSWORD to empty as well. Both need to be set.
Variable: WEBPASSWORD_FILE
default: unset
value: <Docker secret path>
Description: Set an Admin password using Docker secrets.
If WEBPASSWORD is set, WEBPASSWORD_FILE is ignored.
If WEBPASSWORD is empty, and WEBPASSWORD_FILE is set to a valid readable file path, then WEBPASSWORD will be set to the contents of WEBPASSWORD_FILE .
I also deleted setupVars.conf to get rid of the old hashed password.
Then after spinning up the container, the password is set to something random. The content of the secrets-file has been ignored
I also checked if the secrets file is readable from within the container:
Can it be, that the documentation is missleading and the actual docker secret that is supposed to be used is the docker swarm version? Because that's where the link in the documentation is pointing to.
Managed to get this working
Here's how I done it:
Step 1: Save the content of the password to /my/path/mystrongpassword
Step 2: Edit the docker-compose.yml file as follows (irrelevant sections ommited):
On my side, I just wanted to get rid of any clear mention of my password, either on a secret file or inside the docker compose file. What I did is just remove the WEBPASSWORD from the compose.
Then I logged into the container environment by typing: docker exec -it <yourpiholecontainer> bash
and just run the pihole -a -p command to reset my password.
Hope this helps.