title: ERR_CONNECTION_REFUSED by docker container
body: <p>I'm new to Docker and trying to make a demo Rails app. I made a dockerfile that looks like this:</p>
  
  <pre><code>FROM ruby:2.2 
  
  # Install apt based dependencies required to run Rails as 
  # well as RubyGems. As the Ruby image itself is based on a 
  # Debian image, we use apt-get to install those.
  RUN apt-get update &amp;&amp; apt-get install -y \ 
    build-essential \ 
    nodejs
  
  # Configure the main working directory. This is the base 
  # directory used in any further RUN, COPY, and ENTRYPOINT 
  # commands.
  RUN mkdir -p /app 
  WORKDIR /app
  
  # Copy the Gemfile as well as the Gemfile.lock and install 
  # the RubyGems. This is a separate step so the dependencies 
  # will be cached unless changes to one of those two files 
  # are made.
  COPY Gemfile Gemfile.lock ./ 
  RUN gem install bundler &amp;&amp; bundle install --jobs 20 --retry 5
  
  # Copy the main application.
  COPY . ./
  
  # Expose port 3000 to the Docker host, so we can access it 
  # from the outside.
  EXPOSE 3000
  
  # The main command to run when the container starts. Also 
  # tell the Rails dev server to bind to all interfaces by 
  # default.
  CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
  </code></pre>
  
  <p>I then built it (no errors):</p>
  
  <pre><code>docker build -t demo . 
  </code></pre>
  
  <p>And then run it (also no errors):</p>
  
  <pre><code>docker run -itP demo
  =&gt; Booting Puma
  =&gt; Rails 5.1.1 application starting in development on http://0.0.0.0:3000
  =&gt; Run `rails server -h` for more startup options
  Puma starting in single mode...
  * Version 3.8.2 (ruby 2.2.7-p470), codename: Sassy Salamander
  * Min threads: 5, max threads: 5
  * Environment: development
  * Listening on tcp://0.0.0.0:9292
  Use Ctrl-C to stop
  </code></pre>
  
  <p>When I run a <code>docker ps</code> command in a separate terminal to determine the ports, I get:</p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                     NAMES
  55e8224f7c15        demo                "bundle exec rails..."   About an hour ago   Up About an hour    0.0.0.0:32772-&gt;3000/tcp   ecstatic_bohr
  </code></pre>
  
  <p>However, when I try to connect to it at either <code>http://localhost:32772</code> or <code>http://192.168.99.100:32772</code> using Chrome or via a curl command, I receive a "Connection refused".</p>
  
  <p>When I run the app outside of docker on my local machine via <code>bundle exec rails server</code> command, it works fine. Note that I am using Docker Toolbox on my Win7 machine</p>
  
  <p>What could I be doing wrong ?</p>