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