justinribeiro/dockerfiles

can't get /json/version by hostname

RomanDashevsky opened this issue · 0 comments

I'm using docker-compose, here is .yml

version: '3'

services:
  crawler:
    build: ./images/crawler
    environment:
      - DEV_MOD=YES
    volumes:
      - ../../:/var/www/app
    networks:
      - crawler
    stdin_open: true
    tty: true
    ports:
      - "3333:3333"
    depends_on:
      - redis
      - chrome

  chrome:
    image: justinribeiro/chrome-headless
    privileged: true
    networks:
      - crawler
    ports:
      - "9222:9222"

  redis:
    image: redis:5-alpine
    networks:
      - crawler
    ports:
      - "6379:6379"

networks:
  crawler:
    ipam:
      config:
        - subnet: 172.50.0.0/24

I try get data by wget from crawler container:

If I using hostname of chrome container, I get error
/var/www/app # wget http://chrome:9222/json/version
Connecting to chrome:9222 (172.50.0.3:9222)
wget: server returned error: HTTP/1.1 500 Internal Server Error

If I using ip of chrome container, I get 200 responce.
/var/www/app # wget http://172.50.0.3:9222/json/version
Connecting to 172.50.0.3:9222 (172.50.0.3:9222)
version 100% |****************************************************| 422 0:00:00 ETA

Is it chrome issue or my docker-compose config?