anchor.diff:  USER $USER
   WORKDIR /home/$USER
   
  -PCDIR=patent-crawler
  +#
  +## Patent crawler
  +#
  +ENV PCDIR=patent-crawler
   
   RUN mkdir $PCDIR/ && \
       mkdir $PCDIR/conf/ && \
  -    mkdir $PCDIR/lib/ && \
       mkdir $PCDIR/seeds/ && \
  +    mkdir $PCDIR/bin/ && \
  +    mkdir $PCDIR/target/ && \
       chmod -R a+rx $PCDIR/
  +
   # add the patent crawler uber-jar
  -ADD target/patent-crawler-1.0.jar
  +ADD target/patent-crawler-1.0.jar $PCDIR/target/
  +
   # and configuration files
   ADD conf/*.*               $PCDIR/conf/
   ADD seeds/patent-seeds.txt $PCDIR/seeds/
   ADD bin/*.sh               $PCDIR/bin/
  -ADD bin/es_status          $PCDIR/bin/
   
  +USER root
   RUN chown -R $USER:$USER /home/$USER && \
   	chmod -R a+r /home/$USER
   
   
  -# Ports:
  +#
  +## Ports
  +#
   #  8080 - Storm UI
   #  9200 - Elasticsearch http
   #  9300 - Elasticsearch java
   #  5601 - Kibana
   EXPOSE 8080 9200 9300 5601
   
  -# volumes for persistent data
  +#
  +## volumes for persistent data
  +#
   USER root
   RUN mkdir /data
   RUN mkdir /data/elasticsearch && chown elasticsearch:elasticsearch /data/elasticsearch
  
positive.code: 		zookeeperd
  
  #
  # Elasticsearch and Kibana
  #
  RUN wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch \
  	| apt-key add -
  RUN echo "deb https://packages.elastic.co/elasticsearch/2.4.1/debian stable main" \
  	>> /etc/apt/sources.list.d/elasticsearch-2.4.1.list
  RUN echo "deb http://packages.elastic.co/kibana/4.6.1/debian stable main" \
  	>> /etc/apt/sources.list.d/elasticsearch-2.4.1.list
  RUN apt-get update -qq && \
  	apt-get install -yq --no-install-recommends \
  		elasticsearch=2.4.1 \
          kibana=4.6.1
  RUN ln -s /usr/share/elasticsearch/bin/elasticsearch /usr/bin/elasticsearch
  RUN ln -s /opt/kibana/bin/kibana /usr/bin/kibana
  RUN mkdir /var/log/kibana && chown -R kibana:kibana /var/log/kibana
  RUN chown -R kibana:kibana /opt/kibana/
  # install marvel, see https://www.elastic.co/downloads/marvel
  USER elasticsearch
  RUN /usr/share/elasticsearch/bin/plugin install license
  RUN /usr/share/elasticsearch/bin/plugin install marvel-agent
  USER kibana
  RUN /opt/kibana/bin/kibana plugin --install elasticsearch/marvel/latest
  RUN /opt/kibana/bin/kibana plugin --install elastic/sense
  USER root
  # system configuration, see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html
  ADD etc/sysctl.d/60-elasticsearch.conf       /etc/sysctl.d/60-elasticsearch.conf
  ADD etc/supervisor/conf.d/elasticsearch.conf /etc/supervisor/conf.d/elasticsearch.conf
  ADD etc/supervisor/conf.d/kibana.conf        /etc/supervisor/conf.d/kibana.conf
  RUN chmod -R 644 /etc/sysctl.d/60-elasticsearch.conf /etc/supervisor/conf.d/*.conf
  ENV ES_HEAP_SIZE=20g
  # enable updates via scripting
  RUN echo "\n\nscript.engine.groovy.inline.update: true\n" >>/etc/elasticsearch/elasticsearch.yml
  
  #
  # Apache Storm
  #
  ENV STORM_VERSION=1.0.3
  RUN wget -q -O - http://mirrors.ukfast.co.uk/sites/ftp.apache.org/storm/apache-storm-$STORM_VERSION/apache-storm-$STORM_VERSION.tar.gz \
  
negative.code: CMD ["/usr/bin/supervisord"]
  
  # launch the crawl
  CMD ["/home/$USER/$PCDIR/bin/run_patent_crawler.sh"]
  