-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.jupyter
More file actions
37 lines (28 loc) · 1.04 KB
/
Copy pathDockerfile.jupyter
File metadata and controls
37 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Use Python 3.9 slim image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements files
COPY requirements.txt .
COPY pyproject.toml .
# Install Python dependencies including Jupyter
RUN pip install --no-cache-dir -e .
RUN pip install --no-cache-dir jupyter ipywidgets
# Copy source code
COPY . .
# Expose Jupyter port
EXPOSE 8888
# Set up Jupyter configuration
RUN mkdir -p /root/.jupyter
RUN echo "c.NotebookApp.token = ''" >> /root/.jupyter/jupyter_notebook_config.py
RUN echo "c.NotebookApp.password = ''" >> /root/.jupyter/jupyter_notebook_config.py
RUN echo "c.NotebookApp.open_browser = False" >> /root/.jupyter/jupyter_notebook_config.py
RUN echo "c.NotebookApp.allow_root = True" >> /root/.jupyter/jupyter_notebook_config.py
# Copy example notebooks
COPY examples /app/examples
# Run Jupyter notebook by default
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]