title: Docker compose - run shell and application inside shell
body: <p>I'm using docker compose for running my application in dev. environment.</p>
  
  <pre><code>version: '3.4'
  services:
    web:
      build:
        context: .
        target: base
      ports:
       - "5000:5000"
      stdin_open: true
      tty: true 
      volumes:
       - ./src:/src
      command: node src/main/server/index.js
  </code></pre>
  
  <p>Composer is starting container and I can see logs output from node application. When I press <code>CTR-C</code> - container is stopped and my application is stopped as well.</p>
  
  <p>I would like to have my application to be stopped when I press <code>CTRL-C</code> instead of whole container.</p>
  
  <p>The same behavior when running an app within Windows CMD or Linux shell. For example, to restart an app - press <code>CTRL-C</code>, repeat startup command (<code>node src/main/server/index.js</code> by pressing top arrow key), and press enter. </p>
  
  <p>I was thinking I could use something like this, but it does not work.</p>
  
  <pre><code>command: bash -c "node src/main/server/index.js
  </code></pre>
  
  <p>I know I can use command below to achieve expected behavior:</p>
  
  <ul>
  <li><code>docker-compose up -d</code> (to start in detached mode) </li>
  <li><code>docker-compose   exec web bash</code> (run interactive shell) </li>
  <li><code>node src/main/server/index.js</code> (start node manually)</li>
  </ul>
  
  <p>But maybe there is a way to start bash interactive bash and run an application in bash using singe command <code>docker-compose up</code> ?</p>