LoginSignup
8
0

More than 3 years have passed since last update.

GigalixirでPORTを4000以外の値にするのはだめよ (Elixir)

Last updated at Posted at 2020-12-12

この記事は Elixir その2 Advent Calendar 2020 13日目です。
前日は String.replace/3 (Elixir) でした。


はじめに

PORTを3000にする設定を追加してみます

スクリーンショット 2020-12-12 21.24.19.png

  • Unhealthyになっちゃいます

スクリーンショット 2020-12-12 21.25.26.png

  • PORTを4000へUpdateしてみましょう
  • Healthyに戻ります

スクリーンショット 2020-12-12 21.27.34.png

Gigalixirのドキュメント

Our health checks simply check that your app is listening on port $PORT. If you’re running a non-HTTP Elixir app, but need to just get health checks to pass, take a look at https://github.com/jesseshieh/elixir-tcp-accept-and-close

  • Phoenixアプリの場合、Gigalixirのほうで環境変数PORTが4000に設定されていることを期待しています
  • だからPORTを4000以外の値で、利用者自身が書き換えてしまうとUnhealthyになっちまうという流れです

Wrapping Up :christmas_tree::santa::santa_tone1::santa_tone2::santa_tone3::santa_tone4::santa_tone5::christmas_tree:

  • Gigalixirで環境変数PORTに443を設定して、アプリは動いているんだけどヘルスチェックが失敗しているなあ、なんだろうなあ :thinking: と考え込んだことがありました
  • PORTは4000以外にしちゃだめよ
  • Enjoy Elixir!!! :rocket::rocket::rocket::rocket:
  • 一息つきます
  • @mnishiguchi さん続きお願いします
8
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
0