mastodon docker

This commit is contained in:
jkjoy 2023-10-30 11:25:40 +08:00
parent 687ab3c751
commit c6427eb96e
4 changed files with 80 additions and 3 deletions

View File

@ -427,7 +427,7 @@ footer:
<a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a>
<br>
PowerBy 浪子 ©2023
<script async src="https://u.3.ow3.cn/script.js" data-website-id="fa1536bb-54b1-48fd-93db-19daa07c0f1a"></script>
'
# 展示网站的 PV、UV 统计数

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,76 @@
---
title: 使用Docker快速部署mastodon实例
date: 2023-10-30 11:12:43
tags: mastodon
categories: 分享
cover:
---
## 如何使用Docker快速部署mastodon实例
直接使用docker compose部署是不可行的,需要按照步骤进行
### 创建目录
```
mkdir -p /home/mastodon/mastodon
```
### 进入目录
```
cd /home/mastodon/mastodon
```
### 拉取镜像
```
docker pull ghcr.io/mastodon/mastodon
```
### 修改docker compose配置文件
```
wget https://raw.githubusercontent.com/mastodon/mastodon/main/docker-compose.yml
```
修改`docker compose`文件中的版本号
### 初始化PostgreSQL
- 重要!!!!!
```
docker run --name postgres14 -v /home/mastodon/mastodon/postgres14:/var/lib/postgresql/data -e POSTGRES_PASSWORD=设置数据库管理员密码 --rm -d postgres:14-alpine
```
进入数据库
```
docker exec -it postgres14 psql -U postgres
```
创建用户名mastodon的密码
```
CREATE USER mastodon WITH PASSWORD '数据库密码(最好和数据库管理员密码不一样)' CREATEDB;
```
停止docker
```
docker stop postgres14
```
### 配置Mastodon
在`/home/mastodon/mastodon`根文件夹中创建空白`.env.production`文件
```
cd /home/mastodon/mastodon
touch .env.production
```
运行引导
```
docker-compose run --rm web bundle exec rake mastodon:setup
```
按照提示进行操作
`Below is your configuration, save it to an .env.production file outside Docker:`之后会出现配置文件的数据,复制下来
写入`.env.production`中
启动Mastodon
```
docker-compose down
docker-compose up -d
```
文件夹赋权
```
chown 991:991 -R ./public
chown -R 70:70 ./postgres14
docker-compose down
docker-compose up -d
```
创建管理员
```
docker exec mastodon-web-1 tootctl accounts create USERNAME --email EMAIL --confirmed --role Owner
```
至此完成

View File

@ -1,8 +1,9 @@
---
title: 快速部署misskey实例
date: 2023-10-11 16:57:47
tags: 部署
categories: 分享
abbrlink: d29d6713
date: 2023-10-11 16:57:47
cover:
---
## 使用官方推荐一键脚本