Compare commits

...

3 Commits

4 changed files with 130 additions and 1 deletions
+72 -1
View File
@@ -1,2 +1,73 @@
# Jupyter-my-own-image
# 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
+22
View File
@@ -0,0 +1,22 @@
services:
jupyter:
profiles: ["build", "registry"]
image: https://git.seccodesmith.pl/seccodesmith/Jupyter-my-own-image.git
build:
context: .
dockerfile: Dockerfile
ports:
- "8888:8888"
volumes:
- ./notebooks:/notebooks
environment:
- JUPYTER_ENABLE_LAB=yes
restart: unless-stopped
command: >
jupyter notebook
--ip='0.0.0.0'
--port=8888
--no-browser
--NotebookApp.token=''
--NotebookApp.password=''
--allow-root
+24
View File
@@ -0,0 +1,24 @@
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-dev \
git \
wget \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /tmp/
RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r /tmp/requirements.txt
WORKDIR /notebooks
EXPOSE 8888
CMD ["jupyter", "notebook", "--ip='0.0.0.0'", "--port=8888", "--no-browser", "--allow-root"]
+12
View File
@@ -0,0 +1,12 @@
jupyter
notebook
nbconvert
numpy
pandas
opencv-python
scikit-learn
scikit-image
torch
torchvision
torchaudio
imutils