anchor.diff:  FROM debian:jessie
   
   ENV DEBIAN_FRONTEND noninteractive
  -
  -ARG debian_repo="http://dl.bintray.com/v1/content/uwcirg/truenth"
  -
  -COPY artifacts /tmp/artifacts
  -
  -# Only add local repository if packages available in artifacts/
  -RUN \
  -    if [ -n "$(ls -A /tmp/artifacts)" ]; then \
  -        echo deb file:/tmp/artifacts ./ > /etc/apt/sources.list.d/truenth.local.list; \
  -    else \
  -        echo deb ${debian_repo} stable main > /etc/apt/sources.list.d/truenth.list; \
  -    fi
  -
  -
  -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
   
   RUN \
       apt-get update && \
  
positive.code:         libpq5 \
          python2.7 && \
      apt-get clean
  
  # Todo: move to same step as package installation
  RUN rm -rf /tmp/artifacts
  
  ENV PROJECT_DIR="/opt/venvs/portal"
  ENV \
      FLASK_APP="${PROJECT_DIR}/bin/manage.py" \
      LOG_FOLDER="/tmp/shared_service_log" \
      PERSISTENCE_FILE="${PERSISTENCE_FILE:-https://raw.githubusercontent.com/uwcirg/TrueNTH-USA-site-config/master/site_persistence_file.json}" \
      SQLALCHEMY_DATABASE_URI="postgresql://postgres:@db/postgres" \
      CELERY_BROKER_URL="redis://redis:6379/0" \
      REQUEST_CACHE_URL="redis://redis:6379/0" \
      SESSION_REDIS_URL="redis://redis:6379/0"
  RUN mkdir -p ${LOG_FOLDER} ${PROJECT_DIR}/var/portal-instance/
  RUN chown www-data:www-data ${LOG_FOLDER} ${PROJECT_DIR}/var/portal-instance/
  
  COPY portal.wsgi /var/www/
  
  RUN printf '\n\
  <VirtualHost *:80>\n\
  
negative.code: \n'\
  > /etc/apache2/sites-available/portal.conf
  
  ARG debian_repo="http://dl.bintray.com/v1/content/uwcirg/truenth"
  
  COPY artifacts /tmp/artifacts
  
  # Only add local repository if packages available in artifacts/
  RUN \
      if [ -n "$(ls -A /tmp/artifacts)" ]; then \
          echo deb file:/tmp/artifacts ./ > /etc/apt/sources.list.d/truenth.local.list; \
      else \
          echo deb ${debian_repo} stable main > /etc/apt/sources.list.d/truenth.list; \
      fi
  
  RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
  
  RUN \
      apt-get update && \
      apt-get install -y --force-yes portal && \
      apt-get clean
  
  # Todo: move to same step as package installation
  RUN rm -rf /tmp/artifacts
  
  COPY portal.wsgi /var/www/
  
  ENV PROJECT_DIR="/opt/venvs/portal"
  ENV \
      FLASK_APP="${PROJECT_DIR}/bin/manage.py" \
      LOG_FOLDER="/tmp/shared_service_log" \
      PERSISTENCE_FILE="${PERSISTENCE_FILE:-https://raw.githubusercontent.com/uwcirg/TrueNTH-USA-site-config/master/site_persistence_file.json}" \
      SQLALCHEMY_DATABASE_URI="postgresql://postgres:@db/postgres" \
      CELERY_BROKER_URL="redis://redis:6379/0" \
      REQUEST_CACHE_URL="redis://redis:6379/0" \
      SESSION_REDIS_URL="redis://redis:6379/0"
  RUN mkdir -p ${LOG_FOLDER} ${PROJECT_DIR}/var/portal-instance/
  RUN chown www-data:www-data ${LOG_FOLDER} ${PROJECT_DIR}/var/portal-instance/
  
  ENV APACHE_SERVER_NAME=${APACHE_SERVER_NAME:-localhost}
  
  