anchor.diff:      proj-util \
       python3 \
       sqlite \
  -    wget \
     && apk del binutils
   
  -COPY \
  -  requirements-standalone.txt \
  -  requirements-pg.txt \
  -  requirements-dev.txt \
  -  requirements.txt \
  -  ./
   
   RUN apk add --no-cache --virtual .build-deps \
       build-base \
  
positive.code: FROM alpine:3.11
  LABEL maintainer="massimods@met.no,aheimsbakk@met.no"
  
  ENV PYCSW_CONFIG=/etc/pycsw/pycsw.cfg
  
  EXPOSE 8000
  COPY docker/min-apk /usr/local/bin/min-apk
  
  RUN apk add binutils \
    && min-apk \
      bash \
      ca-certificates \
      geos \
      libpq \
  
negative.code:   && pip3 install --upgrade pip setuptools \
    && pip3 install wheel \
    && pip3 install gunicorn \
    && pip3 install --requirement ${PYCSW_HOME}/requirements.txt \
    && pip3 install --requirement ${PYCSW_HOME}/requirements-standalone.txt \
    && pip3 install --requirement ${PYCSW_HOME}/requirements-pg.txt \
    && apk del .build-deps
  
  ADD docker/pycsw.cfg ${PYCSW_CONFIG}
  ADD docker/entrypoint.py /usr/local/bin/entrypoint.py
  
  WORKDIR ${PYCSW_HOME}
  
  RUN pip3 install . \
    && adduser -D -u 1000 pycsw \
    && cp -r ${PYCSW_HOME}/tests /home/pycsw \
    && chown -R pycsw:pycsw /home/pycsw/* \
    && rm -rf /usr/lib/python3*/*/tests \
    && rm -rf /usr/lib/python3*/ensurepip \
    && rm -rf /usr/lib/python3*/idlelib \
    && rm -f /usr/lib/python3*/distutils/command/*exe \
    && rm -rf /usr/share/man/* \
    && rm -fr ${PYCSW_HOME} \
    && find /usr/lib -name  "*.pyc" -o -name "*.pyo" -delete
  
  WORKDIR /home/pycsw
  