API Token is reset after docker container power outage

Hi team! I'm using pihole docker on a Raspberry Pi 1B (yes, "1B") and it's working fine for most of the things, but now that I need to automate some things, I need the Token API.

Using the UI, I could get the Token API but after a while, I've noticed that during my house power outages, the container gets recreated but it lose any new password or even the Token API.

I don't mind too much about the password since I set the WEBPASSWORD environmental variable, but the token API is getting my crazy... any idea why it get's re-created instead of saving to the volumes?

My code is:

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
    environment:
      TZ: 'America/Chicago'
      WEBPASSWORD: 'something'
    # Volumes store your data between container upgrades
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    restart: unless-stopped```

The API token is based on the password.
If the password changes, the token will also change.

Are you using the same WEBPASSWORD: 'something' when the container is recreated?

Thanks rdwebdesign , that explains a lot since I was manually changing it to another password and now I understand why the Token was changed too...

Thanks!