title: How Do You Supply Environment Variables to SBT Running in Docker Compose?
body: <p>I am attempting to run a Play Framework Scala application via Docker Compose, and I would like to supply environment variables to it. Unfortunately, SBT doesn't pick them up when I do supply them via <code>environment</code>:</p>
  <pre><code>environment:
        - http.port=${PORT}
  </code></pre>
  <p>where I have <code>PORT=1234</code> in a <code>.env</code> file in the same directory.</p>
  <p>However, it works just fine when I submit them as part of the command:</p>
  <pre><code>command: &quot;sbt run -Dhttp.port=${PORT}&quot;
  </code></pre>
  <p>I could do it this way in a pinch, but I would rather set the variables within <code>environment</code>.</p>
  <p>So what am I doing wrong?</p>