title: How to enable tty and run interactive console with AWS ECS?
body: <p>Deployed a Dockerized Rails Application on EC2 instance with AWS ECS service. I am using <code>ecs-cli</code> for deploying rails application which using <code>docker-compose.yml</code> file for deploying containers as services similar to <code>docker-compose</code> mode. For running interactive shell such as <code>rails console</code> for my app, I created one separate service with following definition:</p>
  
  <pre><code>version: '2'
  
  volumes: 
    app-tmp:
      driver: local
    app-logs:
      driver: local
  
  services:
    console:
      image: acc-name.dkr.ecr.us-east-1.amazonaws.com/docker_image_name:latest
      command: bundle exec rails c
      hostname: console
      mem_limit: 314572800
      env_file: ../.prod-env
      tty: true
      stdin_open: true
      ports: []
      volumes:
        - "app-logs:/home/app/log"
        - "app-tmp:/home/app/tmp"
  </code></pre>
  
  <p>But when I deploy the task with following command:</p>
  
  <pre><code>ecs-cli compose -f docker/docker-compose-console.yml --project-name app-console run console "bundle exec rails c"
  </code></pre>
  
  <p>The flags <code>tty: true</code> and <code>stdin_open: true</code> are ignored. Due to which the task running console boots up, changes to <code>RUNNING</code> state and then silently closes down with state 0.</p>
  
  <p>Is there any way one can run interactive console session or tailed logs? What approaches are used to achieve similar behavior? </p>
  
  <p><strong>TL;DR</strong>: I want behavior similar to <code>docker-compose run app rails c</code> with AWS ECS service.</p>