域在主机上parsing,但不在docker容器内
我有两个容器,一个运行启动量angular器的Node.js进程,另一个运行独立的Selenium容器。 该文件如下所示:
version: '2' services: www.example.localhost: build: . depends_on: - selenium dns_search: - static.example.localhost extra_hosts: - "static.example.localhost:127.0.0.1" ports: - "3000:3000" - "4000:4000" volumes: - ./src:/code/src - ./api:/code/api entrypoint: "npm run" command: "test:e2e" selenium: dns_search: - selenium.example.localhost image: selenium/standalone-chrome-debug:2.52.0 environment: no_proxy: localhost volumes: - /dev/urandom:/dev/random ports: - "4444:4444" - "6900:5900"
www.example.localhost
运行量angular器,然后通过protractor.config.js中的这些行连接到selenium容器:
seleniumAddress: "http://selenium:4444/wd/hub", directConnect: false,
当我在Selenium容器上运行VNC时,打开容器中的chrome浏览器并键入www.example.localhost:3000
它无法parsing域。 但是,当我运行wget www.example.localhost:3000
它得到的index.html文件就好了。 任何想法我做错了什么?
在Chrome浏览器中,无论您使用哪种DNS设置,任何以localhost
结尾的域都会parsing为127.0.0.1。 将域从.localhost
更改为.dev
修复它。
- Angular4 + Universal + ng-bootstrap导致“意外令牌导入”错误
- 清晰度angular度未find(404错误)
- 一次运行Angular 4 +节点API
- 我们是否需要在bitbucket上推送node_modules
- $ q.allPromises返回一个数组,但我只想要一个元素,而不是全部
- Angular2错误内联模板:1:20导致:超出最大调用堆栈大小
- JavaScript:使用页面对象进行量angular器testing,select下拉列表项目
- 你如何运行Node / Express的纯前端Angular应用程序?
- MSSQL – Nodejs – 未定义不是一个function问题