73 lines
1.8 KiB
Markdown
73 lines
1.8 KiB
Markdown
# Jupyter Notebook Docker Setup
|
|
|
|
This repository contains Docker configuration for running Jupyter Notebook with various data science libraries pre-installed.
|
|
|
|
## Features
|
|
|
|
- Based on Ubuntu Focal (20.04)
|
|
- Includes Jupyter Notebook with:
|
|
- Pandas
|
|
- OpenCV
|
|
- Scikit-learn
|
|
- Scikit-image
|
|
- PyTorch
|
|
- Imutils
|
|
- Notebook export capabilities (nbconvert)
|
|
- Volume mounted for persistent notebook storage
|
|
- Two deployment profiles (build locally or pull from registry)
|
|
|
|
## Directory Structure
|
|
|
|
```
|
|
.
|
|
├── Dockerfile # Docker image definition
|
|
├── docker-compose.yml # Services configuration
|
|
├── requirements.txt # Python package dependencies
|
|
└── notebooks/ # Directory for your Jupyter notebooks (will be created)
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Create notebooks directory
|
|
|
|
```bash
|
|
mkdir -p notebooks
|
|
```
|
|
|
|
### Profile 1: Build locally
|
|
|
|
To build the Docker image locally and run the container:
|
|
|
|
```bash
|
|
docker-compose --profile build up
|
|
```
|
|
|
|
### Profile 2: Pull from your registry
|
|
|
|
To pull the image from your private registry and run it:
|
|
|
|
```bash
|
|
REGISTRY_URL=your-registry-url docker-compose --profile registry up
|
|
```
|
|
|
|
Replace `your-registry-url` with your actual Docker registry URL.
|
|
|
|
## Accessing Jupyter Notebook
|
|
|
|
Once the container is running, access Jupyter Notebook by opening a browser and navigating to:
|
|
|
|
```
|
|
http://localhost:8888
|
|
```
|
|
|
|
No password is required (for simplicity - you may want to add authentication for production use).
|
|
|
|
## Customization
|
|
|
|
- To add more Python packages, modify the `pip3 install` command in the Dockerfile
|
|
- To change the Jupyter configuration, modify the command in docker-compose.yml
|
|
|
|
## Notes
|
|
|
|
- The notebooks directory is mounted as a volume to persist your work
|
|
- For security in production environments, consider adding authentication to your Jupyter instance |