FROM jupyter/%%NOTEBOOK_STACK%%:latest

ENV RENKU_OIC_URL https://testing.datascience.ch/auth/realms/Renku/
ENV RENKU_OIC_CLIENT_ID jupyter

USER root
COPY . /code/renku
RUN chown $NB_USER -R /code/renku
USER $NB_USER

RUN cd /code/renku && \
    pip install --no-cache -e .[notebook]

USER root
RUN jupyter serverextension enable --py renku.notebook.oic && \
    chown $NB_USER -R /home/$NB_USER/.jupyter
USER $NB_USER
