diff --git a/Dockerfile b/Dockerfile
index a06381510d209a3876edda6cb94b4f56456e0308..b46bf0fad895a80efdf3f14b3d0d767d7cf7741f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,21 @@
-# Dockerfile for binder
-# Reference: https://mybinder.readthedocs.io/en/latest/dockerfile.html#preparing-your-dockerfile
+FROM sagemath/sagemath:9.7
 
-FROM sagemath/sagemath:9.1
+ARG NB_UID=1000
+ARG NB_USER=sage
 
-# Copy the contents of the repo in ${HOME}
-COPY --chown=sage:sage . ${HOME}
\ No newline at end of file
+USER root
+RUN apt update && apt install -y python3 python3-pip
+
+USER ${NB_UID}
+ENV PATH="${PATH}:${HOME}/.local/bin"
+RUN pip3 install notebook
+RUN ln -s $(sage -sh -c 'ls -d $SAGE_VENV/share/jupyter/kernels/sagemath') $HOME/.local/share/jupyter/kernels/sagemath-dev
+
+# partially superfluous -- create separate directory to hold notebooks
+WORKDIR ${HOME}/notebooks
+COPY --chown=${NB_UID}:${NB_UID} . .
+USER root
+RUN chown -R ${NB_UID}:${NB_UID} .
+USER ${NB_UID}
+
+ENTRYPOINT []