部署Rust应用及优化订阅者验证
1. Digital Ocean应用部署成本与建议
在Digital Ocean的App Platform上托管应用并非免费,保持应用及其关联数据库的运行每月大约需要20美元。为了控制成本,建议在每次会话结束后销毁应用,这样花费可以控制在1美元以下。例如,在撰写相关内容时,仅花费了0.2美元。
2. 应用规范(App Spec)
Digital Ocean的App Platform使用声明式配置文件(App Spec)来指定应用部署的方式。下面是一个 spec.yaml 文件示例,应将其放置在项目目录的根目录下:
#! spec.yaml
name: zero2prod
# Check https://www.digitalocean.com/docs/app-pla
# for a list of all the available options.
# You can get region slugs from
# https://www.digitalocean.com/docs/platform/avail
# They must specified lowercased.
# `fra` stands for Frankfurt (Germany - EU)
region: fra
services:
- name: zero2prod
# Relative to the repository root
dockerfile_path: Dockerfile
source_dir: .
g
超级会员免费看
订阅专栏 解锁全文
865

被折叠的 条评论
为什么被折叠?



