Dockerfile 821 B

12345678910111213141516171819202122232425
  1. FROM gcr.io/google-appengine/python
  2. # Create a virtualenv for dependencies. This isolates these packages from
  3. # system-level packages.
  4. # Use -p python3 or -p python3.7 to select python version. Default is version 2.
  5. RUN virtualenv /env -p python3
  6. # Setting these environment variables are the same as running
  7. # source /env/bin/activate.
  8. ENV VIRTUAL_ENV /env
  9. ENV PATH /env/bin:$PATH
  10. RUN apt-get update && apt-get install -y python-opencv
  11. # Copy the application's requirements.txt and run pip to install all
  12. # dependencies into the virtualenv.
  13. ADD requirements.txt /app/requirements.txt
  14. RUN pip install -r /app/requirements.txt
  15. # Add the application source code.
  16. ADD . /app
  17. # Run a WSGI server to serve the application. gunicorn must be declared as
  18. # a dependency in requirements.txt.
  19. CMD gunicorn -b :$PORT main:app