title: access docker-compose extra_hosts with no port number
body: <p>I added some extra_hosts in my docker-compose that now looks like this:</p>
  
  <pre><code>version: '3'
  services:
    memcached:
      image: memcached:1.5.2-alpine
      restart: always
      ports:
        - "11211:11211"
  
    postgres:
      image: postgres:9.4-alpine
      restart: always
      volumes:
        - ~/.engine-data/postgres:/var/lib/postgresql/data
      ports:
        - "5432:5432"
      environment:
        - POSTGRES_DB=myapp_development
        - POSTGRES_USER=default
        - POSTGRES_PASSWORD=secret
  
    redis:
      image: redis:3.2.0-alpine
      restart: always
      volumes:
        - ~/.engine-data/redis:/data
      ports:
        - "6379:6379"
  
    web:
      build:
        context: .
        dockerfile: "Dockerfile"
      command: ./wait-for-it.sh redis:6379 -- ./wait-for-it.sh postgres:5432 -- bundle exec rails s -p 3000 -b '0.0.0.0'
      volumes:
        - .:/opt/apps/engine
      depends_on:
        - memcached
        - redis
        - postgres
      ports:
        - "3000:3000"
      env_file:
        - .env
      extra_hosts:
       - "my.api:127.0.0.1"
       - "my.webapp:127.0.0.1"
  </code></pre>
  
  <p>My intention is to access web using my.webapp and no localhost:3000. But instead of that, what I get is my web app running at my.webapp:3000</p>
  
  <p>How can I avoid the port number? </p>