FROM rocker/binder:4.2.1

# jupyterhub must be the same version as in the hub container, otherwise it ends to a 404 error.
ARG JUPYTERHUB_VERSION=3.0.0
USER root

# Due to issue #134 of jupyter-rsession-proxy behind reverse-proxy.
# The problem has been fixed but without upgrading version number and not forwarded to pypi,
# this is why it has to be uninstalled and reinstalled with git repo.
RUN pip uninstall -y jupyter-rsession-proxy && \
    pip install --no-cache \
    jupyterhub==$JUPYTERHUB_VERSION \
    git+https://github.com/jupyterhub/jupyter-rsession-proxy
	
USER ${NB_USER}
WORKDIR /home/${NB_USER}
CMD ["jupyterhub-singleuser"]

