Skip to content

Instantly share code, notes, and snippets.

@gdahlm
Created May 21, 2017 19:39
Show Gist options
  • Select an option

  • Save gdahlm/dc4c08da8e97e10057c3136c93bdaf69 to your computer and use it in GitHub Desktop.

Select an option

Save gdahlm/dc4c08da8e97e10057c3136c93bdaf69 to your computer and use it in GitHub Desktop.
Dockerfile for launching a Jupyter notebook container.
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents
# kernel crashes.
ENV TINI_VERSION v0.6.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini
ENTRYPOINT ["/usr/bin/tini", "--"]
# Uncomment the following if not using with docker-compose
#EXPOSE 8888
#CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment