Koyeb

TIP

Koyeb免费方案包含:

  • 1个WebService (500MB内存,地区可选德国🇩🇪或美国🇺🇸)
  • 1个Postgres(Koyeb的免费数据库每月只提供5小时额度,本教程将使用Supabase免费方案代替)

TIP

The Koyeb free plan includes:

  • 1 Web Service (500 MB RAM, regions: Germany 🇩🇪 or United States 🇺🇸)
  • 1 Postgres (Koyeb’s free database only provides 5 hours per month; this guide uses the Supabase free plan instead)

Deployment Overview ​

  • Create a database on Supabase to persist OpenList configuration data
  • Deploy the OpenList application on Koyeb

部署概览 ​

  • 在Supabase中创建一个数据库用于保存openlist的配置数据
  • 在Koyeb中部署openlist应用

Prerequisites ​

部署前准备 ​

Create the Database ​

Sign in to Supabase.

  1. Create a new project.
  2. In New project, set the Database password and save it. Select Central EU (Frankfurt) as the region.

    Choose a region close to your Koyeb server — Frankfurt or Washington D.C is recommended.

  3. Open the new project and click the Connect button to find the DB_HOST. db_host

创建数据库 ​

登录Supabase

  1. 创建一个新项目
  2. New project中设置 Database password 并记好,Region选择Central EU(Frankfurt)。

    建议选择与Koyeb服务器接近的Region,Frankfurt或Washington D.C

  3. 进入新建的project点击Connect按钮可查看DB_HOST db_host

Create the Service ​

  1. Sign in to the Koyeb console and click Create App.
  2. Select Docker under Web service.
  3. Set Image to openlistteam/openlist:latest and click Next.
  4. Choose the Free instance under CPU Eco 🌱 and click Next.

创建服务 ​

  1. 登录 Koyeb 控制台,点击 Create App。
  2. 选择Web service中的 Docker。
  3. 将 Image 设置为 openlistteam/openlist:latest,点击Next。
  4. 选择CPU Eco 🌱中的Free服务器点击Next

Configure Deployment ​

  1. Enable the Override toggle next to Command.
  2. Enter ./openlist server --config /tmp/config.json in the input box.

    WARNING

    You must specify the config file path; otherwise you will get the error: the current user does not have write and/or execute permissions on the ./data directory (/opt/openlist/data).

设置Deployment ​

  1. 打开Command后的Override开关
  2. 在框中输入 ./openlist server --config /tmp/config.json

    WARNING

    必须指定openlist的配置文件地址,不然会导致 错误:当前用户没有 ./data 目录(/opt/openlist/data)的写和/或执行权限。

deployment

Set up Environment Variables and Files ​

Add environment variables ​

KeyValuePurpose
TZAsia/Shanghai (or any timezone)Set the container timezone
UMASK022https://en.wikipedia.org/wiki/Umask
OPENLIST_ADMIN_PASSWORDInitial admin passwordStrongly recommended; otherwise a random password is generated on every restart
environment

Add configuration file ​

Switch to the Files tab, click Add file, and set Path to /tmp/config.json (matching the path specified in the Command).

Enter the following in File content:

json
{
  "force": false,
  "jwt_secret": "random_generated",
  "database": {
    "type": "postgres",
    "host": "replace_with_your_DB_HOST",
    "port": 5432,
    "user": "postgres",
    "password": "replace_with_your_database_password",
    "name": "postgres",
    "db_file": "",
    "table_prefix": "x_",
    "ssl_mode": "require",
    "dsn": ""
  },
  "scheme": {
    "address": "0.0.0.0",
    "http_port": 5244
  },
  "temp_dir": "/tmp/temp",
  "bleve_dir": "/tmp/bleve",
  "log": {
    "enable": false
  }
}
file

设置 Environment variables and files ​

添加环境变量 ​

KeyValue用途
TZAsia/Shanghai(或任意时区)设置容器时区
UMASK022https://en.wikipedia.org/wiki/Umask
OPENLIST_ADMIN_PASSWORDadmin的起始密码强烈建议设置,不然每次服务重启都会随机生成
environment

添加配置文件 ​

切换到Files,点击Add file,将Path设置为/tmp/config.json(与Command中指定的一致)

File content中填入:

json
{
  "force": false,
  "jwt_secret": "random_generated",
  "database": {
    "type": "postgres",
    "host": "这里替换为你的DB_HOST",
    "port": 5432,
    "user": "postgres",
    "password": "这里替换为你的数据库密码",
    "name": "postgres",
    "db_file": "",
    "table_prefix": "x_",
    "ssl_mode": "require",
    "dsn": ""
  },
  "scheme": {
    "address": "0.0.0.0",
    "http_port": 5244
  },
  "temp_dir": "/tmp/temp",
  "bleve_dir": "/tmp/bleve",
  "log": {
    "enable": false
  }
}
file

Configure Ports ​

Change the Port to 5244.

设置Ports ​

将Port改为5244

Deploy and Verify ​

  1. Review the summary and click Save and deploy.
  2. After a short wait you should see OpenList initialization messages in the LOG panel.
  3. Once deployment is complete, click the link provided by Koyeb to access OpenList.
success

部署与验证 ​

  1. 核对摘要信息后点击 Save and deploy。
  2. 稍等一会就能在LOG窗口中看到 OpenList 的初始化信息。
  3. 如果没有其它问题,部署完成之后即可点击Koyeb给的链接访问openlist了。
success

Updates and Maintenance ​

  • Updates: Go to the Service detail page. If the image is set to latest, simply click Redeploy when a new version is available.
  • Logs: View real-time logs on the Service detail page, or click Details under Scaling.

更新与维护 ​

  • 更新:进入Service详情页,如果之前设置的镜像为latest,当有新版本时手动点击Redeploy即可更新版本
  • 日志:在Service详情页查看实时日志,或在Scaling中点击Details。

Contributors