使用fly.io部署memos

分享
701 0

Memos

是一个好玩的应用

fly.io

是一个免费的服务
拥有3个256MB内存的免费额度和3G的硬盘空间

项目

https://github.com/hu3rror/memos-on-fly

注册

注册FLY.IO

用以部署memos

注册B2C

https://www.backblaze.com/cloud-storage

  • 用以存储memos数据库
  • 新建BUCKET,并获取

安装flyctl

Install flyctl
WINDOWS

pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex"

新建APP

flyctl launch

编辑FLY.TOML

添加以下

[build]
  image = "ghcr.io/hu3rror/memos-litestream:latest"

[env]
  # Details see: https://litestream.io/guides/backblaze/
  LITESTREAM_REPLICA_BUCKET = "B2C桶名称"     # change to your litestream bucket name
  LITESTREAM_REPLICA_ENDPOINT = "s3.us-east-005.backblazeb2.com"     # change to your litestream endpoint url
  LITESTREAM_REPLICA_PATH = "memos_prod.db"     # keep the default or change to whatever path you want

[[mounts]]
  source = "memos_data"
  destination = "/var/opt/memos"

[http_service]
  internal_port = 5230
  force_https = true
  auto_stop_machines = false
  auto_start_machines = true
  min_machines_running = 0

添加持久卷

flyctl volumes create memos_data --region hkg --size 1

密钥

将B2存储的密钥添加到fly的密钥存储中

flyctl secrets set LITESTREAM_ACCESS_KEY_ID="<keyId>" LITESTREAM_SECRET_ACCESS_KEY="<applicationKey>"

部署

flyctl deploy

演示地址

https://memosim.fly.dev/
绑定域名演示
https://imad.top

最后更新 2023-08-14
评论 ( 0 )
OωO
隐私评论