Take a look at all the scripts inside bin/docker. They are very helpful and one of them is migrate.
So, calling ./bin/docker/migrate will migrate your development and test database.
Of course you can also use ./bin/docker rake if you want to execute other rake tasks.
You can also follow the instructions of the Install Discourse on Ubuntu or Debian for Development if you don’t want to use the Docker based environment.