Closed4

Netlify / Render / React Prd

yagi_engyagi_eng

Render

https://zenn.dev/katsumanarisawa/articles/c9da48652f399d
https://render.com/docs/free

Web services on the free plan are automatically spun down after 15 minutes of inactivity. When a new request for a free service comes in, Render spins it up again so it can process the request.
This can cause a response delay of up to 30 seconds for the first request that comes in after a period of inactivity.

Other standard Render features like custom domains, fully managed TLS certificates, pull request previews, log streams, and rollbacks are fully supported.

cannot use port 80

Feb 13 10:24:34 AM  ==> Build successful 🎉
Feb 13 10:24:34 AM  ==> Deploying...
Feb 13 10:24:44 AM  ==> Starting service with './server/app'
Feb 13 10:24:44 AM  
Feb 13 10:24:44 AM     ____    __
Feb 13 10:24:44 AM    / __/___/ /  ___
Feb 13 10:24:44 AM   / _// __/ _ \/ _ \
Feb 13 10:24:44 AM  /___/\__/_//_/\___/ v4.6.1
Feb 13 10:24:44 AM  High performance, minimalist Go web framework
Feb 13 10:24:44 AM  https://echo.labstack.com
Feb 13 10:24:44 AM  ____________________________________O/_______
Feb 13 10:24:44 AM                                      O\
Feb 13 10:24:44 AM  {"time":"2022-02-13T01:24:44.575191171Z","level":"FATAL","prefix":"echo","file":"main.go","line":"55","message":"listen tcp :80: bind: permission denied"}
  • 1024番以上のポートを使う必要がある

https://community.render.com/t/how-ports-and-https-are-handled-for-docker-deploy/363

Render does port detection to figure out where it should forward incoming traffic for your service. If you’re using a particular port, you can speed up port detection by setting a PORT environment variable, but this isn’t necessary. You don’t ever need to expose port 443 or even port 80 for that matter. Render will find the open port where your server is listening for HTTP traffic.

yagi_engyagi_eng

フロントのデプロイをNetlifyにするか、Renderにするか

  • ビルドはNetlifyの方が30secほど早かった
    • Neflify: 2m30s, Render: 3m3s
  • バックエンドをRenderにしてるため、フロントもRenderの方が管理画面が一つで済む
  • Renderではなぜかreact-scriptsがないと言われ、ビルト時にインストールする必要があった
    • ちゃんとしたやり方ありそうだけど今はスルー
  • 統一のためRenderを採用

参考

https://render.com/docs/deploy-create-react-app

このスクラップは2022/02/13にクローズされました