title: Symfony server:run in php Docker container
body: <p>I have a php docker container where is my symfony project.</p>
  
  <p>Here is my <strong>docker-compose.yml</strong></p>
  
  <pre><code>php-fpm:
      build: ./php
      container_name: php-fpm
      links:
          - db
      ports:
          - 9000:9000
          - 8448:8448
          - 8000:8000
      working_dir: /var/www/html/
      volumes:
          - ../app:/var/www/html
      volumes_from:
          - data
      tty: true
      env_file:
          - ./docker.env
      entrypoint: /entrypoint.sh
  </code></pre>
  
  <p>I want to launch my symfony project with this command:</p>
  
  <pre><code>php bin/console server:run localhost:8000
  </code></pre>
  
  <p>But it's not working when I want to access the url. I have this error message:</p>
  
  <blockquote>
    <p>The localhost page isn’t working</p>
    
    <p>localhost didn’t send any data.</p>
  </blockquote>
  
  <p>How can I fix that?</p>
  
  <p>PS: I'm using docker for mac</p>
  
  <p>And  <code>php bin/console -vvv server:run localhost:8000</code> outputs: </p>
  
  <blockquote>
    <p>[2016-08-06 14:09:53] php.DEBUG: fsockopen(): unable to connect to
    localhost:8000 (Connection refused)
    {"type":2,"file":"/var/www/html/symfony-test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"level":28928}</p>
  
  <pre><code>                                                                                                                      [OK] Server running on http://localhost:8000                          
  </code></pre>
    
    <p>// Quit the server with CONTROL-C.                                   </p>
    
    <p>RUN  '/usr/local/bin/php' '-S' 'localhost:8000'
    '/var/www/html/symfony-test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router_dev.php'</p>
  </blockquote>