Skip to content

Instantly share code, notes, and snippets.

@wastemobile
Last active November 21, 2022 08:06
Show Gist options
  • Save wastemobile/3abe021dc899672631794cc86755ce3e to your computer and use it in GitHub Desktop.
Save wastemobile/3abe021dc899672631794cc86755ce3e to your computer and use it in GitHub Desktop.
Install Misskey

Misskey

  1. 在已安裝好 docker 與 docker compose plugin 的 Ubuntu 22.04 LTS 主機上安裝 Misskey。
  2. 在家目錄新建 misskey 目錄。
  3. 建立 docker-compose.yml 檔案,這裡使用 Caddy 2 Server 在前端服務、反向代理。
  4. 建立 Caddyfile。
  5. 建立 config/ 目錄,並新增 default.yml 與 docker.env 兩個檔案,修改網域名稱、資料庫密碼等。
  6. 接著輸入 docker compose run --rm misskey yarn run init 讓 Misskey 容器建立資料庫。
  7. docker compose up -d 啟動。
  8. 稍等一下,前往 https://yourdomain.com 即可看到 Misskey,註冊第一名管理員用戶。
  9. 快樂悠遊聯邦宇宙!
version: "3"
services:
caddy:
image: caddy:alpine
restart: always
container_name: caddy2
ports:
- "80:80"
- "443:443"
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ./Caddyfile:/etc/caddy/Caddyfile
- ./caddy_data:/data
- ./caddy_config:/config
networks:
- internal_network
- external_network
misskey:
image: misskey/misskey:latest
container_name: misskey
links:
- db
- redis
networks:
- internal_network
- external_network
volumes:
- ./config:/misskey/.config:ro
- ./files:/misskey/files
redis:
image: redis:latest
container_name: redis
restart: always
networks:
- internal_network
volumes:
- ./redis:/data
db:
image: postgres:12.2-alpine
container_name: db
restart: always
networks:
- internal_network
env_file:
- ./config/docker.env
volumes:
- ./db:/var/lib/postgresql/data
networks:
internal_network:
internal: true
external_network:
{
email [email protected]
}
yourdomain.com {
reverse_proxy misskey:3001
}
$ mkdir config && cd config
$ nano default.yml
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Misskey configuration
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
url: https://yourdomain.com
port: 3001
db:
host: db
port: 5432
db: misskey
user: postgresql-dbuser
pass: postgresql-pass
redis:
host: redis
port: 6379
id: 'aid'
# db settings
POSTGRES_PASSWORD=example-misskey-pass
POSTGRES_USER=example-misskey-user
POSTGRES_DB=misskey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment