chore(env): sample ファイルのサービスホストを 127.0.0.1 に統一 - #37
Merged
Merged
Conversation
'localhost' は環境によって IPv6(::1) に解決されるため、IPv4/IPv6 で別々のサービスが待ち受けている環境では別インスタンスに接続してしまう。frontend リポジトリの同一趣旨の修正(PR #20)と対になる sample ファイルの同期。 - .env.example / .env.test.example: REDIS_HOST と DATABASE_URL のホストを 127.0.0.1 に変更 - FRONTEND_URLS は移行期間を考慮し 127.0.0.1 と localhost の両方を許可 - .env.development は gitignore 対象のため各ローカルで同様の修正が必要(コメントに要領を記載済)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
sample 環境変数ファイルのサービスホストを
127.0.0.1に統一します。背景
localhostは環境によって IPv6(::1) に解決されます。Windows + WSL のように IPv4/IPv6 で別々のサービスが待ち受けている環境では、localhost指定のプロセスと127.0.0.1指定のプロセスが別の Redis インスタンスに接続することが実際に起きました(フロント E2E の検証コードが別 Redis に書かれタイムアウト。frontend PR #20 の調査で判明)。変更
.env.example/.env.test.exampleREDIS_HOST=localhost→127.0.0.1DATABASE_URLのホストも127.0.0.1に統一FRONTEND_URLSは移行を考慮しhttp://127.0.0.1:3000,http://localhost:3000の両許可.env.developmentは gitignore 対象(各ローカル設定)のため、同内容を手元で修正し、sample 側に要領のコメントを記載済み影響
localhostが IPv4 のみに解決される環境では挙動は変わりません