「Fly.io」:修訂間差異

出自Gea-Suan Lin's Wiki
跳至導覽 跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
(创建页面,内容为“'''Fly.io'''是一個SaaS供應商。 == 外部連結 == * {{Official|https://fly.io/}} {{en}}”)
 
 
(未顯示同一使用者於中間所作的 1 次修訂)
行 1: 行 1:
'''Fly.io'''是一個[[SaaS]]供應商。
'''Fly.io'''是一個[[SaaS]]供應商。
== Cheatsheet ==
=== PHP ===
這邊是先在<code>Dockerfile</code>裡面使用[https://hub.docker.com/r/richarvey/nginx-php-fpm/ richarvey/nginx-php-fpm]的image,並且指定<code>public/</code>目錄才是webroot,同時這個image預設會將服務在port 80:
<syntaxhighlight lang="dockerfile">
ARG WEBROOT=/var/www/html/public
FROM richarvey/nginx-php-fpm:3.1.5
</syntaxhighlight>
接著在<code>fly.toml</code>裡面設定對應的參數:
<syntaxhighlight lang="toml">
app = "example-app-12345"
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "nrt"
processes = []
[build]
  dockerfile = "Dockerfile"
[env]
  PORT=8080
[experimental]
  auto_rollback = true
[[services]]
  http_checks = []
  internal_port = 80
  min_machines_running = 0
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [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"
</syntaxhighlight>


== 外部連結 ==
== 外部連結 ==


* {{Official|https://fly.io/}} {{en}}
* {{Official|https://fly.io/}} {{en}}

於 2023年6月9日 (五) 19:38 的最新修訂

Fly.io是一個SaaS供應商。

Cheatsheet

PHP

這邊是先在Dockerfile裡面使用richarvey/nginx-php-fpm的image,並且指定public/目錄才是webroot,同時這個image預設會將服務在port 80:

ARG WEBROOT=/var/www/html/public
FROM richarvey/nginx-php-fpm:3.1.5

接著在fly.toml裡面設定對應的參數:

app = "example-app-12345"
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "nrt"
processes = []

[build]
  dockerfile = "Dockerfile"

[env]
  PORT=8080

[experimental]
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 80
  min_machines_running = 0
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [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"

外部連結