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