centos8 docker安装mastodon
1. 安装docker
curl -sSL https://get.docker.com/ | sh2.安装docker-compos
curl -L "https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
3.验证
4.启动docker并设置开机自启动
systemctl start docker && systemctl enable docker && systemctl is-enabled docker5. 安装nginx
6. 拉取mastodon docker镜像
docker pull tootsuite/mastodon7. 拉取代码(主要是docker-compose.yml)
直接拉取:
git clone https://github.com/tootsuite/mastodon.git --progress --verbose
断点续传方式:(推荐)
git init
git fetch https://github.com/tootsuite/mastodon.git
8. #SECRET_KEY_BASE设定
sed -i "s/SECRET_KEY_BASE=$/&$(docker-compose run --rm web bundle exec rake secret)/" .env.production
9. #OTP_SECRET设定
sed -i "s/OTP_SECRET=$/&$(docker -compose run --rm web bundle exec rake secret)/" .env.production
10. #获取vapid keys
将以下指令获取的密钥复制至.ENV.PRODUCTION的OTP_SECRET选项下方:
docker-compose run --rm web bundle exec rake mastodon:webpush:generate_vapid_key
cat .env.production git diff docker-compose.yml11. 设置public、elasticsearch文件夹权限:
chown -R 991:991 public
/workspace/mastodon/elasticsearch 目录需要777权限,否则es一直重启
chmod -R 777 elasticsearch
12. 启动数据库:
docker-compose run --rm web bundle exec rake db:migrate
13. 启动MASTODON实例
docker-compose up -d
docker-compose ps -a14. 创建管理员账户
docker-compose run --rm web tootctl accounts create k1ic --email k1ic234@163.com --confirmed --role admin
15. 从浏览器访问
https://nft.k1ic.com/参考:
常见长毛象站点一览
https://instances.social/list/old
与 Mastodon 相关的内容精选清单
https://asmcn.icopy.site/awesome/awesome-mastodon/
https://kaedemochi.blogspot.com/2020/08/dockermastodon.html
https://pullopen.github.io/%E5%9F%BA%E7%A1%80%E6%90%AD%E5%BB%BA/2020/10/19/Mastodon-on-Docker.html
https://pullopenbluebox.wordpress.com/2020/06/07/mastodon-self-instance/
https://pullopen.github.io/2020/07/19/How-to-build-a-mastodon-instance.html
https://www.dazhuanlan.com/2020/02/29/5e597c54a13ac/
https://blog.kaede.im/2020/08/dockermastodon.html
https://blog.dann.top/archives/14
http://wap.mail.163.com/xm/static/html/163_symbian_2.html