Skip to content

使用Fly.io部署OpenCat for Team

Published: at 04:12 PMSuggest Changes

Table of Contents

Open Table of Contents

原因

因为国内无法直接访问openai,openai也不支持国内区域。部署后,可以让朋友们一起使用,免去了一些复杂过程。

[OpenCat](OpenCat on the App Store (apple.com))

Fly.io

准备

私有部署

1. 配置文件

使用𝔽𝕣𝕠𝕤𝕥 𝕄𝕚𝕟𝕘分享的配置

kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "sin"
processes = []

[build]
  image = "bayedev/opencatd"

[mount]
  source = "opencat"
  destination = "/opt/db"

[experimental]
  auto_rollback = true

[[services]]
  internal_port = 80
  protocol = "tcp"

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

2. 安装fly的命令行工具

Install flyctl · Fly Docs

#Mac
brew install flyctl

#Linux
curl -L https://fly.io/install.sh | sh

#Windows
powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"

3. 登录fly

fly auth login

4. 本地建立目录,创建fly.tomal文件并复制上面的配置内容

5. 创建和部署App

创建的区域节点尽量选择美国的

fly launch --copy-config
fly vol create opencat --size 1
fly deploy

6. 绑定域名

Fly.io提供SSL证书,在dashboard中配置一下

7. 在 OpenCat 中配置


Previous Post
为项目添加git template,并从远程仓库拉取更新
Next Post
Use Qr Code to Display Wifi Password