aTypically, Appwrite can be upgraded by using the following command:
docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ appwrite/appwrite:target.version
However, this assumes the user is using the default configuration of named volumes for data storage. In my case I am using host bind mounts for data storage instead.
To handle this, backup all data from your instance (including docker-compose.yml and .env), cd to the parent of the directory that contains your appwrite docker-compose.yaml, then run this command.
Then go back to the directory with docker-compose.yml. Replace .env with your old .env and replace all instances of "- appwrite-" with "- ./". This will turn every volume like "appwrite-uploads" to "./uploads". Success!