title: Is there a way to automatically activate a virtualenv as a docker entrypoint?
body: <p>I have a flask app inside of a docker container. I would like to use the python package zappa to deploy that app to Amazon Web Services.</p>
  
  <p>Unfortunately zappa requires that it and all of my apps dependencies be installed in a python <strong>virtual environment</strong>.</p>
  
  <p>So I have rebuilt my docker image and moved everything into a virtual environment in it.</p>
  
  <p>The problem is that now i can't run commands like:</p>
  
  <pre><code>docker exec &lt;container&gt; flask &lt;sub command&gt;
  </code></pre>
  
  <p>because flask is installed in a virtual environment which has not been activated.</p>
  
  <p>I can still do this:</p>
  
  <pre><code>host$ docker exec -it &lt;container&gt; bash
  
  container$ source venv/bin/activate
  container$ flask &lt;sub command&gt;
  </code></pre>
  
  <p>Also, I can no longer run my default Dockerfile CMD (gunicorn) because that is also is my virtual environment.</p>
  
  <p>Does this make any more sense?</p>