Я планирую запустить селен-побегер в docker, но возникает ошибка ECONNREFUSED connect ECONNREFUSED
это мой docker -compose.yml
services:
django: &django
build:
context: .
dockerfile: ./compose/local/django/Dockerfile
depends_on:
- postgres
- webpack
- redis
volumes:
- .:/app
env_file:
- .env
ports:
- "8000:8000"
command: /start.sh
stdin_open: true
tty: true
selenium-hub:
image: selenium/hub:3.141.59-20200409
container_name: selenium-hub
ports:
- "4444:4444"
selenium-browsers:
image: selenium/node-chrome:3.141.59-20200409
volumes:
- /dev/shm:/dev/shm
depends_on:
- selenium-hub
environment:
- HUB_HOST=selenium-hub
- HUB_PORT=4444
this мой dockerfile, который устанавливает Selen-Side-Runner
RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash
RUN apt-get install -y nodejs
RUN apt-get install -y npm
RUN npm install -g selenium-side-runner
мой код
test_file_list = os.listdir(self.save_path)
for ind, file in enumerate(test_file_list):
file_path = os.path.join(self.save_path, file)
start_time = timezone.now()
result = subprocess.run(
['selenium-side-runner', '--server', 'http://selenium-browsers:4444/wd/hub',
file_path])
end_time = timezone.now()
Когда docker запустился, я тестировал http: // selenium-browsers: 4444, конечно Я изменил его на локальный адрес, который полностью доступен