Skip to content

Instantly share code, notes, and snippets.

@ronaldsuwandi
Last active June 24, 2024 23:04
Show Gist options
  • Save ronaldsuwandi/8c4362d223d16d68d7369df2ffd5f185 to your computer and use it in GitHub Desktop.
Save ronaldsuwandi/8c4362d223d16d68d7369df2ffd5f185 to your computer and use it in GitHub Desktop.
Docker Compose for Jupyter Lab/Notebook (no token/password required)
version: "3.9"
services:
jupyter:
image: quay.io/jupyter/scipy-notebook
ports:
- "8888:8888"
volumes:
- ./notebooks:/home/jovyan/
environment:
JUPYTER_ENABLE_LAB: "yes"
@daweimau
Copy link

daweimau commented Jan 5, 2022

Thanks, this was annoying

@neonwatty
Copy link

very helpful! thanks!

@sanchesfranklin
Copy link

thanks, but don't work for me...

@ronaldsuwandi
Copy link
Author

@sanchesfranklin what do you mean by doesn't work? did you do docker compose start command?

jupyter

@muhamad-ridwant-tech
Copy link

Then.. how to use custom password ?

@muhamad-ridwant-tech
Copy link

version: "3.9"

services:
jupyter:
image: jupyter/scipy-notebook
ports:
- "8888:8888"
# volumes:
# - ./notebooks:/home/jovyan/
environment:
JUPYTER_ENABLE_LAB: "yes"
command: "start-notebook.sh --NotebookApp.token='Ridwan_Ganteng"

@dunithd
Copy link

dunithd commented Feb 26, 2024

Thank you! This was helpful!

@ronaldsuwandi
Copy link
Author

the whole idea for this docker-compose is to get rid of the password though 😆

@madhuritm
Copy link

madhuritm commented Apr 26, 2024

The docker container is created But I can't reach the jupyter notebook. Please help! It's driving me crazy
Screenshot 2024-04-26 151912

@rafaelrdealmeida
Copy link

Doesn't work on the jupyter/all-spark-notebook image?

@ronaldsuwandi
Copy link
Author

@madhuritm which port are you using? it should be localhost:8888

@rafaelrdealmeida
Copy link

localhost:8888

Hello, yes. My docker compose is like this

version: '3'

services:
  jupyterlab:
    image: jupyter/all-spark-notebook
    ports:
      - "8889:8888"  # JupyterLab
    volumes:
      - ./data:/hdvm12/datalake  # persistent storage
    environment:
      - JUPYTER_ENABLE_LAB=yes 

  spark-master:
    image: bitnami/spark:latest
    ports:
      - "8080:8080"  # Spark Web UI
      - "7077:7077"  # Spark master
    environment:
      - SPARK_MODE=master

  spark-worker:
    image: bitnami/spark:latest
    environment:
      - SPARK_MODE=worker
      - SPARK_MASTER_URL=spark://spark-master:7077
    
    volumes:
      - ./data:/hdvm12/datalake
    depends_on:
      - spark-master

@ronaldsuwandi
Copy link
Author

@rafaelrdealmeida your docker compose port is mapping 8889 to localhost 8888. My understanding is the default port for Jupyter is 8888. Try changing your port to both 8888

@madhuritm
Copy link

@madhuritm which port are you using? it should be localhost:8888

Thank you for your reply. I had something configured wrong on my putty.

@rafaelrdealmeida
Copy link

@rafaelrdealmeida your docker compose port is mapping 8889 to localhost 8888. My understanding is the default port for Jupyter is 8888. Try changing your port to both 8888

Thank you for your reply. It really was a default port error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment