如何利用fly.io搭建哪吒探針前端開發
導讀:前端開發前端開發 clientid: "" # 在 https://github.com/settings/developers 創建,無需審核 Callback 填 http網站seo優化課程公司網站建設。
1.從github拉取哪吒探針最新源碼,進入源碼根目錄。
2.修改cmd/dashboard/main.go:
import ( "...." "...." "os" "fmt" "...." "...." "...." ) .... .... func init() { //新建conf文件 file6, err := os.Create("data/config.yaml") if err != nil { fmt.Println(err) } data := `debug: false httpport: 80 grpcport: 7777 oauth2: type: "github" #Oauth2 登錄接入類型,gitee/github admin: "" #管理員列表,半角逗號隔開 clientid: "" # 在 https://github.com/settings/developers 創建,無需審核 Callback 填 http(s)://域名或IP/oauth2/callback clientsecret: "" site: brand: "名字" cookiename: "nezha-dashboard" #瀏覽器 Cookie 字段名,可不改 theme: "default" ` file6.WriteString(data) file6.Close() // 初始化 dao 包 singleton.Init() singleton.InitConfigFromPath("data/config.yaml") singleton.InitDBFromPath("data/sqlite.db") singleton.InitLocalizer() initSystem() } flyctl deploy #填寫相關配置信息3.編輯生成的fly.toml為:
app = "名字" kill_signal = "SIGINT" kill_timeout = 5 process網站建設es = [] [env] [experimental] allowed_public_ports = [] auto_rollback = true [mounts] destination = "/dashboard/data" source = "卷名,seo網站關鍵詞優化隨便起,下面用的到" [[services]] http_checks = [] internal_port = 80 processes = ["app"] protocol = "tcp" script_checks = [] [services.concurrency] hard_limit = 25 soft_limit = 20 type = "connections" [[services.ports]] handlers = ["http"] port = 80 [[services.ports]] handlers = ["tls", "http"] port = 443 [[services.tcp_checks]] grace_period = "1s" interval = "15s" restart_limit = 0 timeout = "2s" [[services]] http_checks = [] internal_port = 7777 processes = ["app"] protocol = "tcp" script_checks = [] [services.concurrency] hard_limit = 25 soft_limit = 20 type = "connections" [[公司網站建設services.ports]] port = 7777 [[services.tcp_checks]] grace_period = "1s" interval = "15s" restart_limit = 0 timeout = "2s"4.為了數據持久化,創建一個卷存放數據:
fly volumes create 卷名 --region hkg --size 15.啟動:
fly deploy --no-cache --remote-only6.等待創建完畢就大功告成了!
demo:https://mynezhatz.fly.dev/
相關網站seo優化課程公司網站建設。關鍵詞標簽: 哪吒探針
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-28 ,文章如何利用fly.io搭建哪吒探針前端開發主要講述哪吒探針網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_11439.html