title: Get PHP container on port 8000 after php artisan serve
body: <p>I can't container to listen on port 8000, even after adding the port mapping on my docker-compose.yml file.</p>
  
  <p>All relevant files can be found here: <a href="https://github.com/salvatore-esposito/laravel-dockerized" rel="nofollow noreferrer">https://github.com/salvatore-esposito/laravel-dockerized</a></p>
  
  <p>I ran the following commands: <code>docker-compose exec app php artisan serve</code> and it has run successfully.</p>
  
  <p>Anyway if I go inside the container, curl works as expected, but it doesn't work from the outside. The connection gets refused.</p>
  
  <p>I fetched the ip using <code>docker-machine ip</code></p>
  
  <p>Please note that I mapped the outside-inside port in my container via docker-compose.yml even if in the repository there si no map.</p>
  
  <p>I tried to copy all files to a built image and launch:</p>
  
  <p><code>docker run --rm -p 8000:8000 --name laravel salvio/php-laravel php artisan serve</code></p>
  
  <p>and</p>
  
  <p><code>docker exec -it laravel bash</code></p>
  
  <p>Once more time if a run "curl localhost:80" and "curl localhost:8000" the former doesn't work and the latter it does whereas if I take the container's ip via docker inspect name_container and digit curl ip_of_container:8000 nothing.</p>