title: Docker-compose container: how to alias port?
body: <p>I had used Adminer in Docker (from standard <a href="https://hub.docker.com/_/adminer/" rel="nofollow noreferrer">image</a>) with <code>docker-compose</code>:</p>
  
  <p><code>docker-compose.yml</code>:</p>
  
  <pre><code>version: '2'
  services:
    adminer:
      image: adminer
      restart: always
      ports:
        - '8080:8080'
  </code></pre>
  
  <p><code>/etc/hosts</code> (in main system):</p>
  
  <pre><code>172.19.0.6  adminer.ll
  </code></pre>
  
  <p>It worked fine, when i typed <code>adminer.ll:8080</code> into browser, I got Adminer.</p>
  
  <p>Then I decided, that I want this address to be only <code>adminer.ll</code> without the port <code>8080</code> (it means change exposed port from <code>8080</code> to <code>80</code>).</p>
  
  <p>So I changed <code>ports</code> parameter:</p>
  
  <pre><code>version: '2'
  services:
    adminer:
      image: adminer
      restart: always
      ports:
        - '80:8080'
  </code></pre>
  
  <p>But it is not working. When I type <code>adminer.ll</code> into browser, it can't connect. Interesting is, that <code>adminer.ll:8080</code> is still working.</p>
  
  <p>Port <code>8080</code> is exposed by <code>EXPOSE</code> directive from Adminer image. But why doesn't my <code>ports</code> parameter translate it to <code>80</code>? Am I missing something?</p>
  
  <p>Output of <code>docker-compose ps</code>:</p>
  
  <pre><code>          Name                         Command               State          Ports        
  -----------------------------------------------------------------------------------------
  docker_adminer_1            entrypoint.sh docker-php-e ...   Up      0.0.0.0:80-&gt;8080/tcp
  </code></pre>
  
  <p>It looks like it is listening for all IPs and translating port <code>80</code> to port <code>8080</code>, but it is not.</p>
  
  <p>Thanks.</p>