LoginSignup
1
1

More than 5 years have passed since last update.

docker for mac + angular(ng serve) + virtualbox経由でアクセス

Posted at

docker-compose で起動した node 内から
ng serve で起動した angular アプリに
virtualbox(IE11検証用)からアクセスしたかったができなかった。

mac からは ng serve するときの host を 0.0.0.0 とすることでアクセスは可能。
virtualboxでmac側のip (10.0.2.2)を見に行った時にも見えるようにしたかった。

--disableHostCheck true

#または angular.jsonないで

{
    ...
    "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "mock:build",
            "host": "0.0.0.0",
            "port": 4200,
            "disableHostCheck": true
          },
    ...
}

で無事見えるようになった
http://10.0.2.2:4200

1
1
0

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
1
1