## 参考项目 https://github.com/hu3rror/memos-on-fly ## 准备工作 1.注册FLY.IO 用以部署memos 2.注册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文件 ## 编辑FLY.TOML 添加以下内容 ``` [build] image = "ghcr.io/hu3rror/memos-litestream:latest" #如果不需要备份数据库则可以选择官方的docker镜像ghcr.io/usememos/memos:latest #使用官方镜像可以删掉env的部分 [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 ``` ## 添加1g存储空间 ``` flyctl volumes create memos_data --region hkg --size 1 ``` ## 添加密钥 将B2存储的密钥添加到fly的密钥存储中, 使用官方镜像可以忽略此步骤 ``` flyctl secrets set LITESTREAM_ACCESS_KEY_ID="" LITESTREAM_SECRET_ACCESS_KEY="" ``` ## 部署 执行 ``` flyctl deploy ``` 看到成功的提示可打开域名查看 ## 演示地址 https://memosim.fly.dev/ 绑定域名演示 https://imad.top ## 下载数据库 `fly.io`部署`artalk`或者`memos`后,使用SFTP下载SQLite 数据库 ``` flyctl sftp get ./data/artalk.db #数据库路径 ``` Loading... <div class="tip share">请注意,本文编写于 595 天前,最后修改于 566 天前,其中某些信息可能已经过时。</div> ## 参考项目 https://github.com/hu3rror/memos-on-fly ## 准备工作 1.注册FLY.IO 用以部署memos 2.注册B2C https://www.backblaze.com/cloud-storage 用以同步备份memos数据库 新建BUCKET,并获取`<keyId>`和`<applicationKey>` ## 安装flyctl Install flyctl 以WINDOWS为例 ``` pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex" ``` 其他系统请参照官方 ## 新建APP 初始化 ``` flyctl launch ``` 按照提示选择会生成一个FLY.TOML文件 ## 编辑FLY.TOML 添加以下内容 ``` [build] image = "ghcr.io/hu3rror/memos-litestream:latest" #如果不需要备份数据库则可以选择官方的docker镜像ghcr.io/usememos/memos:latest #使用官方镜像可以删掉env的部分 [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 ``` ## 添加1g存储空间 ``` 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 ## 下载数据库 `fly.io`部署`artalk`或者`memos`后,使用SFTP下载SQLite 数据库 ``` flyctl sftp get ./data/artalk.db #数据库路径 ``` [AD]【腾讯云】年度爆款2核2G4M云服务器118元/年,新老用户同享 最后修改:2023 年 09 月 12 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 2 如果觉得我的文章对你有用,请随意赞赏
2 条评论
白嫖才是硬道理,又给自己的VPS省一点资源!
没错,哈哈~