Most likely, you still have a volume from an old postgres container. Check your existing Docker volumes with docker volume ls and remove the unnecessary one using docker volume rm. The password will not be reset if the container has already been initialized. On a new container, the POSTGRES_PASSWORD_FILE env var works perfectly.