hexo/source/_posts/快速部署misskey实例.md

104 lines
2.9 KiB
Markdown
Raw Normal View History

2023-10-12 10:11:06 +08:00
---
title: 快速部署misskey实例
tags: 部署
categories: 分享
2023-10-30 11:25:40 +08:00
abbrlink: d29d6713
2024-05-09 16:35:20 +08:00
excerpt: >-
ai:
这篇文章介绍了如何使用官方推荐的一键脚本在纯净的Ubuntu系统上安装MISSKEY并提供了双核心四线程的配置建议。文章详细说明了更新软件、使用一键脚本和更新MISSKEY脚本的步骤包括系统重启和特定软件包版本的更新方法。此外还讲解了如何使用Docker
Compose部署MISSKEY包括环境准备、GIT仓库克隆、配置文件编辑、镜像构建、容器启动及设置反向代理的完整流程。
2023-10-30 11:25:40 +08:00
date: 2023-10-11 16:57:47
2023-10-12 10:11:06 +08:00
cover:
---
## 使用官方推荐一键脚本
使用纯净的Ubuntu系统安装,推荐配置双核心四线程.
### 更新软件
```
sudo apt update; sudo apt full-upgrade -y; sudo reboot
```
### 一键脚本
```
wget https://raw.githubusercontent.com/joinmisskey/bash-install/main/ubuntu.sh -O ubuntu.sh; sudo bash ubuntu.sh
```
按照提示输入内容
### 更新misskey脚本
更新 Misskey 的脚本不会升级运行环境。 对于脚本的更新内容,另请参阅 “更新日志”
```
wget https://raw.githubusercontent.com/joinmisskey/bash-install/main/update.ubuntu.sh -O update.sh
```
```
sudo bash update.sh
```
- 使用 systemd 的小伙伴, 添加 -r 可以更新并重启系统。
- 使用 docker 的小伙伴, 可以特定软件包版本 repository:tag 来更新。
## 使用docker compose部署
### 环境
- git
- docker
- nginx
### 步骤
#### git克隆仓库
```
cd /opt
git clone -b master https://github.com/misskey-dev/misskey.git
cd misskey
git checkout master
```
#### 复制配置文件:
```
cp .config/example.yml .config/default.yml
cp .config/docker_example.env .config/docker.env
cp docker-compose.yml.example docker-compose.yml
```
#### 编辑default.yml中
`url`设置为实例域名
db:`host`设置为`db`
redis:`host`设置为`redis`
#### 构建镜像
```
docker compose build
docker compose run --rm web yarn run init
```
完成之后
#### 启动容器
```
docker compose up -d
```
#### 反向代理
参考以下
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache1:16m max_size=1g inactive=720m use_temp_path=off;
server {
listen 80;
listen [::]:80;
server_name misskey.example.com;
client_max_body_size 0;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_cache cache1;
proxy_cache_lock on;
proxy_cache_use_stale updating;
add_header X-Cache $upstream_cache_status;
}
}
```