title: How can I drop into a bash shell with docker-compose?
body: <p><strong>Intention:</strong>
  I am trying to figure out how to use the command <code>docker-compose up --build</code> to build a machine with an Apache/PHP7.1 service acting as a web server and a MSSQL service as the database for the app that is served from the web server.</p>
  
  <p>I need to be able to type in commands to the docker container while I build this development environment (so that I can look at the PHP logs, etc), but since the web server is running, my terminal is occupied with the output from the web server and when I press <code>ctrl+Z</code>, it actually puts the docker process in the background.</p>
  
  <p><strong>The question:</strong>
  Is there anyway that I can run this docker-compose.yml file and have it drop me into the shell on the guest machine?</p>
  
  <p><strong>Service 1:</strong></p>
  
  <pre><code>webserver:
      image: php:7.1-apache
      stdin_open: true
      tty: true
      volumes:
        - ./www:/var/www/html
      ports:
        - 5001:80
  </code></pre>
  
  <p><strong>Service 2:</strong></p>
  
  <pre><code>mssql:
      image: microsoft/mssql-server-linux
      stdin_open: true
      tty: true
      environment:
        - ACCEPT_EULA=Y
      volumes:
        - ./www:/var/www/html
      ports:
        - 1433:1433
      depends_on:
        -webserver
  </code></pre>