MastodonをDockerでどっかーっと一発で動かすための便利なdocker-compose.yml
です。
$ sudo useradd mastodon
$ sudo usermod -aG docker mastodon
$ sudo -u mastodon mkdir -p ~mastodon/live
$ cd ~mastodon/live
$ sudo -u mastodon wget https://gist.github.com/ykzts/64e188dc7cd1cf6b98ff98678da5b267/raw/docker-compose.yml
$ sudo -u mastodon wget https://gist.github.com/ykzts/64e188dc7cd1cf6b98ff98678da5b267/raw/update.sh
$ sudo -u mastodon wget -O .env.production https://github.com/tootsuite/mastodon/raw/v1.2.2/.env.production.sample
$ sudo -u mastodon -e .env.production
$ sudo -u mastodon docker-compose pull
$ sudo -u mastodon docker-compose run --rm web ./bin/rails db:schema:load assets:precompile
$ sudo -u mastodon docker-compose up -d
$ sudo -u mastodon docker-compose scale sidekiq=3
$ cat << __EOS | sudo tee -a /etc/cron.daily/mastodon > /dev/null
#!/bin/sh
cd /home/mastodon/live && sudo -u mastodon docker-compose run --rm web ./bin/rails mastodon:daily > /dev/null
__EOS
$ sudo chmod +x /etc/cron.daily/mastodon
$ cd ~mastodon/live
$ sudo -u mastodon -e docker-compose.yml
$ sudo -u mastodon ./update.sh