anchor.diff:  FROM python:2.7-slim
   MAINTAINER CERN <info@invenio-software.org>
   
  +# expose the right port
  +EXPOSE 28080
  +
  +# add invenio user
  +RUN useradd --home-dir /home/invenio --create-home --shell /bin/bash --uid 1000 invenio
  +
  +# set work dir
  +WORKDIR /code
  +
   # nodejs repo
   # detects distribution and adds the right repo
   # See: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#debian-and-ubuntu-based-linux-distributions
  
positive.code: # add volumes
  # do this AFTER `chown`, because otherwise directory permissions are not
  # preserved
  VOLUME /code
  VOLUME /home/invenio
  VOLUME /tmp
  
  # global environment variables
  ENV INVENIOBASE_INSTANCE_PATH /home/invenio/instance
  ENV INVENIOBASE_STATIC_FOLDER /home/invenio/static
  
  # install init scripts
  ENTRYPOINT ["/code/scripts/docker_boot.sh"]
  
negative.code:     rm -rf /var/lib/{apt,dpkg}/ && \
      (find /usr/share/doc -depth -type f ! -name copyright -delete || true) && \
      (find /usr/share/doc -empty -delete || true) && \
      rm -rf /usr/share/man/* /usr/share/groff/* /usr/share/info/* && \
      pip install --upgrade pip && \
      pip install ipdb \
          ipython \
          mock \
          unittest2 \
          watchdog \
          && \
      npm update && \
      npm install --silent -g bower less clean-css uglify-js requirejs
  
  
  ###############################################################################
  ## 2. Requirements (semi-stable)                                             ##
  ###############################################################################
  
  # global environment variables:
  #  - docker specific paths for Invenio
  #  - proper requirements level
  #  - Python extras
  ENV INVENIOBASE_INSTANCE_PATH="/home/invenio/instance" \
      INVENIOBASE_STATIC_FOLDER="/home/invenio/static" \
      REQUIREMENTS="devel" \
      REXTRAS="development,docs"
  #ENV REQUIREMENTS lowest
  #ENV REQUIREMENTS release
  
  # add requirement files
  COPY ./requirements-devel.txt ./requirements.py ./setup.cfg ./setup.py /code/
  COPY ./invenio/version.py /code/invenio/version.py
  
  # install python requirements
  # the different levels get composed from different sources
  # higher levels include all requirements of lower levels
  # NOTE: the compilation step is not that important, because it also compiles some tests
  #       for modules that contain syntax errors on purpose (e.g. flask-registry)
  RUN python requirements.py --extras=$REXTRAS --level=min > requirements.py.lowest.txt && \
      python requirements.py --extras=$REXTRAS --level=pypi > requirements.py.release.txt && \
      python requirements.py --extras=$REXTRAS --level=dev > requirements.py.devel.txt && \
      pip install --requirement requirements.py.$REQUIREMENTS.txt --allow-all-external && \
      (python -O -m compileall || true)
  
  
  ###############################################################################
  