🐳
Dockerコンテナであげたフロントエンドのブラウザー(クライアントサイド)から別のDockerコンテナに向けたAPIコールを成功させる設定
ローカル(Mac PC)で複数のDockerコンテナを上げてAPI通信(コンテナ間通信)するときに、localhostだと上手くいかないので、host.docker.internalを指定するが、それだと、WebブラウザからのAPIコールでhost.docker.internalが見つからないと怒られてエラー。
Failed to load resource: A server with the specified hostname could not be found.
それを解決するためには、/etc/hostsに127.0.0.1 host.docker.internalを書いたら解決するよ、というお話。
あ〜日本語だとすごい説明が楽だ。
Discussion