Sign inSign up

jakkph32/jupyter-docker-compose

By jakkph32

•Updated over 1 year ago

Image
0

93

jakkph32/jupyter-docker-compose repository overview

⁠JupitorNotebooks Project

⁠Running with Docker Compose

⁠Prerequisites
  • Docker
  • Docker Compose
⁠Steps
  1. Build and run the Docker containers:

    docker compose up --build -d
    
  2. Access Jupyter Notebook in your web browser at http://localhost:8888. Token is token.

⁠Dockerfile

# Use an official Jupyter Docker image as a parent image
FROM jupyter/base-notebook:latest

# Set environment variables
ENV JUPYTER_ENABLE_LAB: yes
ENV JUPYTER_TOKEN: token
ENV NB_USER: jupyternb
ENV NB_UID: 1000
ENV NB_GID: 100
ENV CHOWN_HOME: yes
ENV CHOWN_HOME_OPTS: -R

USER root

# Copy the Jupyter notebooks to the working directory
COPY . /home/jovyan/work

# Set the working directory
WORKDIR /home/jovyan/work

# Expose the port Jupyter uses
EXPOSE 8888

# Start Jupyter notebook
CMD ["start-notebook.sh"]

⁠docker-compose.yml

---
services:
  jupyter:
    build: .
    container_name: jupyter-notebooks
    ports:
      - 8888:8888
    volumes:
      - .:/home/jovyan/work
    command: "start-notebook.sh"
    user: root
    environment:
      JUPYTER_ENABLE_LAB: yes
      JUPYTER_TOKEN: token
      NB_USER: jupyternb
      NB_UID: 1000
      NB_GID: 100
      CHOWN_HOME: yes
      CHOWN_HOME_OPTS: -R

Tag summary

Content type

Image

Digest

sha256:05d22228f…

Size

324.1 MB

Last updated

over 1 year ago

docker pull jakkph32/jupyter-docker-compose