Docker-selenium: Connection refused

Created on 16 Jan 2018  路  8Comments  路  Source: SeleniumHQ/docker-selenium

Meta -

Image(s): selenium/standalone-chrome

Docker-Selenium Image Version(s): latest

Docker Version: 17.12.0-ce-mac47

OS: OSX High Sierra

I have the following docker-compose.yml

version: "3"

services:
  app:
    image: <custom_image>
    restart: always
    volumes:
      - .:/app
    depends_on:
      - "mysql"
      - "webdriver"
    ports:
      - 80:80

  mysql:
    image: mysql:5.7
    restart: always
    ports:
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: qwerty

  webdriver:
    image: selenium/standalone-chrome
    restart: always

Expected Behavior -

The project is running on PHP7.1 and Yii2. I'm running acceptance tests by codeception in couple with Facebook\WebDriver. In my custom image, i've configured Nginx with option server_name: app. When I run tests I've got CONNECTION REFUSED error. Meanwhile, I can ping from webdriver service app service by service names. Also, I can reach http://app/ by curl from webdriver service.

Actual Behavior -

I've got connection refused error.

R-awaiting-answer

Most helpful comment

I figured out what the problem is. The GoogleChrome redirecting http://app to https://app also as http://dev and all domains having TLD .dev

All 8 comments

Hi @varp,

How does your test look like? Probably the urls used in it should use the app name as well, right?

Hi, @diemol . You right the urls in tests also use app. Below you can see my config for Yii

class_name: AcceptanceTester
modules:
  enabled:
    - \tests\codeception\modules\DbHelper
    - \tests\codeception\frontend\common\AcceptanceHelper
    - WebDriver:
        browser: 'chrome'
        url: 'http://app/'
        window_size: '1400x900'
        host: 'webdriver'
        port: '4444'

When I connect by to webdriver container and install curl, I can easyly access the http://app/

https://imgur.com/a/rNCNq There is screenshot of what error show Chrome

I figured out what the problem is. The GoogleChrome redirecting http://app to https://app also as http://dev and all domains having TLD .dev

Sorry we didn't have time to check it, but glad it works @varp :)

Thx, it works !

@varp How you resolved?

@Leoxxid my problem was that I've used .dev which blocked by Chrome. I mean since version 63 of Chrome, .dev gTLD is used for internal use. Now, I'm using .test gTLD for developing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lluisteamcmp picture lluisteamcmp  路  6Comments

testphreak picture testphreak  路  3Comments

timmipetit picture timmipetit  路  6Comments

pfluegs picture pfluegs  路  4Comments

matthewsamari picture matthewsamari  路  4Comments