title: How do I make docker-compose on OS X work with a Play app?
body: <p>I am trying to run a Dockerized <a href="https://github.com/aknuds1/play-docker-example" rel="noreferrer">Play app</a> on OS X via <a href="https://docs.docker.com/compose/" rel="noreferrer">docker-compose</a> 1.1.0/<a href="http://boot2docker.io/" rel="noreferrer">boot2docker</a> 1.5.0. However, it doesn't really, well, play (pardon the pun)...</p>
  
  <p>The problem is that the app must run with a pseudo TTY (provided by Docker), and this makes boot2docker hang while trying to attach.</p>
  
  <p>I run the app, through <code>docker-compose up</code>, and it hangs as shown below:</p>
  
  <pre><code>&gt; docker-compose up
  Recreating exampleapp_web_1...
  Attaching to exampleapp_web_1
  </code></pre>
  
  <p>However, if I run the app directly, without docker-compose, it works:</p>
  
  <pre><code>&gt; docker rm exampleapp_web_1 ; docker run -p 9000:9000 -ti --name exampleapp_web_1 -v `pwd`:/code -v `pwd`/.docker_home:/root exampleapp_web
  [info] Loading project definition from /code/project
  [info] Set current project to example-app (in build file:/code/)
  
  --- (Running the application, auto-reloading is enabled) ---
  
  [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
  
  (Server started, use Ctrl+D to stop and go back to the console...)
  </code></pre>
  
  <p>How do I make docker-compose work in my scenario?</p>
  
  <h1>docker-compose.yml</h1>
  
  <pre><code>web:
    build: .
    command: run
    ports:
      - "9000:9000"
    volumes:
      - .:/code
      - .docker_home:/root
    stdin_open: true
    tty: true
  </code></pre>
  
  <h1>Dockerfile</h1>
  
  <pre><code>FROM aknudsen/play-with-node
  MAINTAINER Arve Knudsen &lt;arve.knudsen@gmail.com&gt;
  
  COPY ./ /code
  WORKDIR /code
  
  EXPOSE 9000
  
  ENTRYPOINT ["sbt"]
  CMD ["run"]
  </code></pre>
  
  <h1>Verbose output from <code>docker-compose up</code></h1>
  
  <pre><code>&gt; docker-compose --verbose up
  Compose version 1.1.0
  Docker base_url: https://192.168.59.103:2376
  Docker version: KernelVersion=3.18.5-tinycore64, Arch=amd64, ApiVersion=1.17, Version=1.5.0, GitCommit=a8a31ef, Os=linux, GoVersion=go1.4.1
  docker containers &lt;- (all=True)
  docker containers -&gt; (list with 3 items)
  Creating exampleapp_web_1...
  docker containers &lt;- (all=True)
  docker containers -&gt; (list with 3 items)
  docker images &lt;- (name=u'exampleapp_web')
  docker images -&gt; (list with 1 items)
  docker create_container &lt;- (tty=True, name=u'exampleapp_web_1', image=u'exampleapp_web', stdin_open=True, environment={}, command='run', volumes={u'/code': {}, u'/root': {}}, detach=False, ports=[u'9000'])
  docker create_container -&gt; {u'Id': u'dc0ebc7e34ea8793023a968725ab696e1a3d60341105e84e81ace776952f55d8',
   u'Warnings': None}
  docker inspect_container &lt;- (u'dc0ebc7e34ea8793023a968725ab696e1a3d60341105e84e81ace776952f55d8')
  docker inspect_container -&gt; {u'AppArmorProfile': u'',
   u'Args': [u'run'],
   u'Config': {u'AttachStderr': True,
               u'AttachStdin': True,
               u'AttachStdout': True,
               u'Cmd': [u'run'],
               u'CpuShares': 0,
               u'Cpuset': u'',
               u'Domainname': u'',
               u'Entrypoint': [u'sbt'],
  ...
  docker start &lt;- (u'dc0ebc7e34ea8793023a968725ab696e1a3d60341105e84e81ace776952f55d8', links=[], cap_add=None, restart_policy=None, dns_search=None, network_mode=u'bridge', binds={u'/Users/arve/Projects/example-app/.docker_home': {u'bind': u'/root', u'ro': False}, u'/Users/arve/Projects/example-app': {u'bind': u'/code', u'ro': False}}, dns=None, volumes_from=[], port_bindings={u'9000': [u'9000']}, cap_drop=None, privileged=False)
  docker start -&gt; None
  docker containers &lt;- (all=False)
  docker containers -&gt; (list with 2 items)
  Attaching to exampleapp_web_1
  docker attach &lt;- (u'dc0ebc7e34ea8793023a968725ab696e1a3d60341105e84e81ace776952f55d8', stderr=1, logs=1, stream=1, stdout=1)
  docker attach -&gt; &lt;generator object _multiplexed_response_stream_helper at 0x1062db2d0&gt;
  </code></pre>
  
  <h1>Log of Docker container</h1>
  
  <pre><code>&gt; docker logs exampleapp_web_1
  [info] Loading project definition from /code/project
  [info] Set current project to example-app (in build file:/code/)
  
  --- (Running the application, auto-reloading is enabled) ---
  
  [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
  
  (Server started, use Ctrl+D to stop and go back to the console...)
  </code></pre>
  
  <h1>GitHub Issue</h1>
  
  <p>There's a <a href="https://github.com/docker/compose/issues/1229" rel="noreferrer">GitHub issue</a> that seems to be describing this very problem.</p>