paulo@112: # Use the official lightweight Python image.
paulo@112: # https://hub.docker.com/_/python
paulo@112: FROM python:3.6-slim 
paulo@112: 
paulo@112: # Copy local code to the container image.
paulo@112: ENV APP_HOME /app
paulo@112: WORKDIR $APP_HOME
paulo@112: COPY . ./
paulo@112: 
paulo@112: # Install production dependencies.
paulo@112: RUN pip install -r requirements.pip
paulo@112: 
paulo@112: # Run the web service on container startup. Here we use the gunicorn
paulo@112: # webserver, with one worker process and 8 threads.
paulo@112: # For environments with multiple CPU cores, increase the number of workers
paulo@112: # to be equal to the cores available.
paulo@112: CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 myw_flask_app:app