title: App running in Docker container on port 4567 can't be accessed from the outside
body: <p>Updating the post with all files required to recreate the setup. – Still the same problem. Not able to access service running in container.</p>
  
  <pre><code>FROM python:3
  
  RUN apt-get update
  RUN apt-get install -y ruby rubygems
  RUN gem install sinatra
  
  WORKDIR /app
  ADD . /app/
  
  EXPOSE 4567
  CMD ruby hei.rb -p 4567
  </code></pre>
  
  <p><strong>hei.rb</strong></p>
  
  <pre><code>require 'sinatra'
  
  get '/' do
    'Hello world!'
  end
  </code></pre>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>version: '2'
  
  services:
    web:
      build: .
      ports:
        - "4567:4567"
  </code></pre>
  
  <p>I'm starting the party by running <code>docker-compose up --build .
  </code>
  <strong>docker ps</strong> returns:
  <code>0.0.0.0:4567-&gt;4567/tcp</code></p>
  
  <p><strong>Still, no respons from port 4567. Testing with curl from the host machine.</strong></p>
  
  <pre><code>$ curl 127.0.0.1:4567 # and 0.0.0.0:4567
  </code></pre>
  
  <p><strong>localhost:4567 replies within the containter</strong></p>
  
  <pre><code>$ docker-compose exec web curl localhost:4567
  Hello world!%`
  </code></pre>
  
  <p>What should I do to be able to access the Sinatra app running on port 4567?</p>