【发布时间】:2016-08-25 01:24:39
【问题描述】:
我有两个容器,一个运行一个启动量角器的 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 运行量角器,而量角器又通过 protractor.config.js 中的这些行连接到 selenium 容器:
seleniumAddress: "http://selenium:4444/wd/hub",
directConnect: false,
当我在 selenium 容器上运行 VNC 时,打开容器内的 chrome 浏览器并输入 www.example.localhost:3000 它无法解析域。但是,当我运行 wget www.example.localhost:3000 时,它会很好地获取 index.html 文件。知道我做错了什么吗?
【问题讨论】:
标签: node.js selenium docker protractor docker-compose