Flisk 的 flisk up 將 Goose 當作一般 BYO 應用程式處理
flisk up Treats Goose Like Every Other BYO App
Flisk 的 flisk up 可按一般 BYO 應用程式方式運行 Goose,前提是容器符合 Flisk 的通用要求。應用程式需處理監聽位址、主機允許清單及 DATABASE_URL 等相容問題;Goose 不需要特殊處理。健康檢查回應 200 只代表服務可用,並不代表映像檔已通過負載測試。
Part 4 of Any language on Flisk. The BYO doc says docker run is not enough. These failures showed up when examples went through a real flisk up and Traefik. They are not Goose-specific.
flisk doctor --no-ping
flisk config verify
flisk up shop --dry-run
flisk up shop
A cold cache is slow. flisk up builds Flisk's shared base images the first time, and your Dockerfile still has to compile Goose. Give the first check several minutes. Then curl the URL --dry-run printed:
curl -fsS http://api.<project>.localhost/api/goose/health
Expect {"status":"ok"}.
Failures the doc already recorded
| What breaks | What you see | Fix in the app, not in Flisk |
|---|---|---|
Bind 127.0.0.1
|
Container runs. Traefik never gets a 200. | Bind 0.0.0.0. Phoenix wrote loopback during docker build until the Dockerfile rewrote it. |
Host allowlist |
Blocked-host response. Rails did this. | Allow api.<project>.localhost, or any host. Gin, Flask, chi, and Echo needed no change. |
DATABASE_URL |
A framework connects to Flisk's Postgres and crashes. Rails returned 500. | Flisk sets that URL in every BYO container, even with no database. This Goose server does not read it. |
A 404 from your process means the path inside the container was not /health. A 404 from Traefik means the route was not registered: duplicate name, --no-proxy, or the container never stayed up.
If Docker says all predefined address pools have been fully subnetted, init-networks fails and the service does not start. Free networks from projects you are not using:
flisk down --prune-networks
After the 200
Change server.goose, then rebuild the image. Flisk will not sync that file into the container. flisk config verify should still pass, because you did not edit .autogenerated/.
A green curl means this language is on the stack. It does not mean the image was load-tested. The BYO doc says a production image was not checked for any example. Most of those examples run a dev server. Yours is a small health server. Treat it as a local dev container.
That is the whole feature. Any language, one resource type, your Dockerfile, four rules. Goose is not a special case once the container meets them.
來源:DEV Community · dev.to