title: DOCKER: Running shell script inside container hangs
body: <ul>
  <li>I am currently trying to dockerize a codeigniter application cloned from <a href="https://github.com/kenjis/codeigniter-composer-installer" rel="nofollow noreferrer">here</a>.</li>
  <li>I used a base lamp stack image from docker hub found <a href="https://hub.docker.com/r/firespring/apache2-php" rel="nofollow noreferrer">here</a></li>
  </ul>
  
  <p>My dockerfile looks like this currently:</p>
  
  <pre><code>FROM firespring/apache2-php
  
  WORKDIR /var/www/spaceship
  COPY . .
  
  EXPOSE 8000
  
  CMD ["bin/server.sh"]
  </code></pre>
  
  <p>But when I try to run it it with:</p>
  
  <pre><code>$ docker run -p 1234:8000 spaceship
  </code></pre>
  
  <p>it hangs.</p>
  
  <p>I tried verifying if my base image was not compatible with it:</p>
  
  <pre><code>$ docker run --rm -it --entrypoint=/bin/bash spaceship
  
  root@fa09751cd081:/var/www/spaceship# ls
  
  Dockerfile  README.md  application  bin  composer.json  composer.lock  favicon.ico  public  vendor
  
  root@fa09751cd081:/var/www/spaceship# bin/server.sh
  
  PHP 5.5.9-1ubuntu4.24 Development Server started at Sat Apr  6 02:51:44 2019
  Listening on http://127.0.0.1:8000
  Document root is /var/www/spaceship/public
  Press Ctrl-C to quit.
  </code></pre>
  
  <p>but apparently it works inside the container locally.</p>
  
  <p>So I guess my question is how do i write the proper dockerfile for this?</p>