1つのRailsアプリ内で複数ドメインのサービスを動かしたい時、皆さんはどうやって開発しますか? 自分なら、ローカル環境で任意のドメインにアクセスできるように環境を作るところから始めます。 ホストPCのDNSの設定は変えたくないな〜と思いながら、Dockerだけでドメイン設定ができないだろうかと試行錯誤していました。 その時、大変な事を発見しました...!!!! Chromeだと、DNSの設定とかせずに localhost のサブドメインにアクセスできる!! なんだって〜〜〜〜!!! 衝撃すぎていままでDockerで頑張ってた設定は全部なかったことにしました。 どういうこと? 普段皆さんは、ブラウザで localhost:3000 にアクセスして動作確認しますよね。 その localhost のサブドメインが使えるんですよ!!! 例えば kanahebi.localhost:3000 とか