hexo/source/_posts/在fly.io部署artalk评论系统.md

65 lines
1.2 KiB
Markdown
Raw Normal View History

2023-10-03 11:14:36 +08:00
---
title: 在fly.io部署artalk评论系统
tags:
- artalk
published: true
categories: 推荐
abbrlink: c80a64e9
date: 2023-08-15 09:37:00
cover:
---
众所周知`Fly.io`是一个免费的SAAS平台
提供三个内存为256MB的服务器,总3G硬盘空间.
为防止滥用,需要绑定信用卡.
## 准备
安装官方的命令行工具flyctl
## 初始化
```
flyctl launch
```
根据提示创建一个app
## 创建一个1G的硬盘
1G的硬盘用来储存评论数据绰绰有余了
```
flyctl volumes create artalk_data --region hkg --size 1
```
## 编辑FLY.TOML
```
#根据自动生成的FLY.TOML文件修改
app = "atim"
primary_region = "hkg"
[build]
image = "artalk/artalk-go"
[http_service]
internal_port = 23366
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
[[mounts]]
source = "artalk_data"
destination = "/data"
[experimental]
vm = true
```
## 在 fly.toml 文件目录执行
```
flyctl ssh console
```
创建一个管理员账号
```
./artalk admin
```
如需重启则执行
```
flyctl apps restart
```