docker exec live_db_1 pg_dump -Fc -U mastodon mastodon_production > 20210309.dump tar --exclude=public/system/cache -zcf mastodon_system_backup_20210309.tar.gz public/system/ git fetch --tags # fetch all tags from the remote, leaving the working directory intact git stash # stash any changes made to the working directory (typically only docker-compose.yml file) git checkout v3.3.0 # checkout working directory to the v3.3.0 release git stash pop # restore any changes you made to the working directory (i.e. passwords in docker-compose.yml files, verify via git diff) docker-compose build # build the web, streaming and sidekiq services, they all share the same container image. This may take a while. docker images # you should see the freshly build image at the top, something like: tootsuite/mastodon latest aa82ba57a3f4 About a minute ago 1.98GB docker-compose run --rm -e SKIP_POST_DEPLOYMENT_MIGRATIONS=true web rails db:migrate # Run the pre-deployment database migrations # You can check the return code via echo $?, if the rc is zero than the migration was successful docker-compose down # shutdown all docker-compose services docker-compose run --rm web bin/tootctl cache clear # clear cache docker-compose run --rm web rails db:migrate # Run post-deployment database migrations, again verify that it succeeded via echo $?. 0 means success docker-compose up -d # create and start containers, detaching from their stdout docker system prune -a # remove unused docker data (images, containers, volumes)