centos8 docker安装mastodon

1. 安装docker

centos8 docker安装mastodon_第1张图片
curl -sSL https://get.docker.com/ | sh
centos8 docker安装mastodon_第2张图片

2.安装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.验证

centos8 docker安装mastodon_第3张图片

4.启动docker并设置开机自启动

systemctl start docker && systemctl enable docker && systemctl is-enabled docker


5. 安装nginx

centos8 docker安装mastodon_第4张图片

6. 拉取mastodon docker镜像

centos8 docker安装mastodon_第5张图片
docker pull tootsuite/mastodon

7. 拉取代码(主要是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

centos8 docker安装mastodon_第6张图片
cat .env.production


centos8 docker安装mastodon_第7张图片
git diff docker-compose.yml


11. 设置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

centos8 docker安装mastodon_第8张图片
docker-compose ps -a


14. 创建管理员账户

docker-compose run --rm web tootctl accounts create k1ic --email [email protected] --confirmed --role admin


15. 从浏览器访问

centos8 docker安装mastodon_第9张图片
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

你可能感兴趣的:(centos8 docker安装mastodon)