Update Dockerfile to use gunicorn w/ multithread (#807)

* Update Dockerfile to use gunicorn w/ multithread

* Update Dockerfile

* Update Dockerfile
This commit is contained in:
Andrew Gorcester 2019-02-25 16:04:48 -08:00 committed by Knative Prow Robot
parent f1279aabf7
commit 290ca7dd59
1 changed files with 6 additions and 3 deletions

View File

@ -8,11 +8,14 @@ WORKDIR $APP_HOME
COPY . .
# Install production dependencies.
RUN pip install Flask
RUN pip install Flask gunicorn
# Service must listen to $PORT environment variable.
# This default value facilitates local development.
ENV PORT 8080
# Run the web service on container startup.
CMD ["python", "app.py"]
# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app