anchor.diff:          && add-apt-repository -y ppa:chris-lea/node.js \
           && apt-get -y update \
           && apt-get -y install python-django-tagging python-simplejson python-memcache python-ldap python-cairo python-pysqlite2 python-support \
  -            python-pip gunicorn supervisor nginx-light nodejs git wget curl openjdk-7-jre build-essential python-dev \
  +            python-pip gunicorn supervisor nginx-light git wget curl openjdk-7-jre build-essential python-dev libffi-dev \
           && apt-get autoclean \
           && apt-get clean \
           && apt-get autoremove
  
positive.code: ENV GRAPHITE_VERSION=1.0.1 \
      STATS_VERSION=v0.8.0 \
      DJANGO_VERSION=1.11.2 \
      TWISTED_VERSION=17.1.0 \
      GRAFANA_VERSION=4.3.2
  
  RUN     pip install Twisted==$TWISTED_VERSION \
          && pip install Django==$DJANGO_VERSION \
          && pip install pytz
          
  RUN     npm install ini chokidar        
  
  # Checkout the stable branches of Graphite, Carbon and Whisper and install from there
  # Install StatsD
  
negative.code: 
  RUN     mkdir -p /opt/graphite/storage/whisper \
          && touch /opt/graphite/storage/graphite.db /opt/graphite/storage/index \
          && chown -R www-data /opt/graphite/storage \
          && chmod 0775 /opt/graphite/storage /opt/graphite/storage/whisper \
          && chmod 0664 /opt/graphite/storage/graphite.db \
          && cp /src/graphite-web/webapp/manage.py /opt/graphite/webapp 
          && cd /opt/graphite/webapp/ \
          && python manage.py migrate --run-syncdb --noinput
  
  # Configure Grafana
  ADD     ./grafana/custom.ini /opt/grafana/conf/custom.ini
  
  RUN	cd /src \
      && wizzy init \
  	&& extract() { cat /opt/grafana/conf/custom.ini | grep $1 | awk '{print $NF}'; } \
  	&& wizzy set grafana url $(extract ";protocol")://$(extract ";domain"):$(extract ";http_port")	\		
  	&& wizzy set grafana username $(extract ";admin_user")	\
  	&& wizzy set grafana password $(extract ";admin_password")
  	
  # Add the default dashboards
  RUN 	mkdir /src/datasources \
          && mkdir /src/dashboards
  ADD	    ./grafana/datasources/* /src/datasources
  ADD     ./grafana/dashboards/* /src/dashboards/
  ADD     ./grafana/export-datasources-and-dashboards.sh /src/
  
  # Configure nginx and supervisord
  ADD     ./nginx/nginx.conf /etc/nginx/nginx.conf
  