Skip to content

Commit 9712d8f

Browse files
committed
Add information on rake tasks to readme
1 parent 3319473 commit 9712d8f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,27 @@ And finally
7070

7171
As usual, the first thing you would need to do would be to run migrations:
7272

73-
docker-compose run web rails db:migrate
73+
docker-compose run --rm web rails db:migrate
7474

7575
And since the instance running in the container will be running in production mode, you need to pre-compile assets:
7676

77-
docker-compose run web rails assets:precompile
77+
docker-compose run --rm web rails assets:precompile
7878

7979
The container has two volumes, for the assets and for user uploads. The default docker-compose.yml maps them to the repository's `public/assets` and `public/system` directories, you may wish to put them somewhere else. Likewise, the PostgreSQL and Redis images have data containers that you may wish to map somewhere where you know how to find them and back them up.
8080

81+
**Note**: The `--rm` option for docker-compose will remove the container that is created to run a one-off command after it completes. As data is stored in volumes it is not affected by that container clean-up.
82+
83+
### Tasks
84+
85+
- `rake mastodon:media:clear` removes uploads that have not been attached to any status after a while, you would want to run this from a periodic cronjob
86+
- `rake mastodon:push:clear` unsubscribes from PuSH notifications for remote users that have no local followers. You may not want to actually do that, to keep a fuller footprint of the fediverse or in case your users will soon re-follow
87+
- `rake mastodon:push:refresh` re-subscribes PuSH for expiring remote users, this should be run periodically from a cronjob and quite often as the expiration time depends on the particular hub of the remote user
88+
- `rake mastodon:feeds:clear` removes all timelines, which forces them to be re-built on the fly next time a user tries to fetch their home/mentions timeline. Only for troubleshooting
89+
90+
Running any of these tasks via docker-compose would look like this:
91+
92+
docker-compose run --rm web rake mastodon:media:clear
93+
8194
### Updating
8295

8396
This approach makes updating to the latest version a real breeze.

0 commit comments

Comments
 (0)