-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.jupyter
35 lines (25 loc) · 1.33 KB
/
Dockerfile.jupyter
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
FROM python:3.11
# Set up a non-root user
RUN useradd -m jupyter
WORKDIR /home/jupyter/workspace
# Copy the library files (only copy the checkpoint-redis directory)
COPY ./libs/checkpoint-redis /home/jupyter/workspace/libs/checkpoint-redis
# Create necessary directories and set permissions
RUN mkdir -p /home/jupyter/workspace/libs/checkpoint-redis/examples && \
chown -R jupyter:jupyter /home/jupyter/workspace
# Switch to non-root user
USER jupyter
# Set up virtual environment
RUN python -m venv /home/jupyter/venv
ENV PATH="/home/jupyter/venv/bin:$PATH"
# Install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir langgraph==0.3.25 && \
pip install --no-cache-dir -e /home/jupyter/workspace/libs/checkpoint-redis && \
pip install --no-cache-dir jupyter redis langchain-openai langchain-anthropic python-ulid
# Set the working directory to the examples folder
WORKDIR /home/jupyter/workspace/libs/checkpoint-redis/examples
# Expose Jupyter port
EXPOSE 8888
# Start Jupyter Notebook with checkpoints disabled
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''", "--NotebookApp.allow_root=True", "--NotebookApp.disable_check_xsrf=True", "--FileContentsManager.checkpoints_kwargs={'root_dir':'/tmp/checkpoints'}"]