@@ -6,15 +6,66 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-ins
66ENV PIP_DEFAULT_TIMEOUT=100 \
77 PIP_DISABLE_PIP_VERSION_CHECK=1 \
88 PIP_NO_CACHE_DIR=1 \
9- JUPYTER_CONFIG_PATH="/home/user/.jupyter"
9+ JUPYTER_CONFIG_PATH="/root/.jupyter" \
10+ IPYTHON_CONFIG_PATH="/root/.ipython"
1011
1112
1213COPY ./requirements.txt requirements.txt
1314RUN pip install --no-cache-dir -r requirements.txt && ipython kernel install --name "python3" --user
14- COPY ./jupyter_server_config.py /home/user/.jupyter /
15+ COPY ./jupyter_server_config.py $JUPYTER_CONFIG_PATH /
1516
16- RUN mkdir -p /home/user/.ipython /profile_default
17- COPY ipython_kernel_config.py /home/user/.ipython /profile_default/
17+ RUN mkdir -p $IPYTHON_CONFIG_PATH /profile_default
18+ COPY ipython_kernel_config.py $IPYTHON_CONFIG_PATH /profile_default/
1819
19- COPY ./start-up.sh /home/user/.jupyter/
20- RUN chmod +x /home/user/.jupyter/start-up.sh
20+ COPY ./start-up.sh $JUPYTER_CONFIG_PATH/
21+ RUN chmod +x $JUPYTER_CONFIG_PATH/start-up.sh
22+
23+
24+
25+ # Use the E2B-specific base image
26+ FROM e2bdev/code-interpreter:latest
27+
28+ # Set environment variables to avoid interactive prompts during package installation
29+ ENV DEBIAN_FRONTEND=noninteractive
30+
31+ # Update the package list and install necessary packages
32+ RUN apt-get update && apt-get install -y \
33+ curl \
34+ wget \
35+ git \
36+ python3 \
37+ python3-pip \
38+ && apt-get clean \
39+ && rm -rf /var/lib/apt/lists/*
40+
41+ # Install Node.js and npm
42+ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
43+ apt-get install -y nodejs
44+
45+ # Copy the requirements.txt file into the Docker image
46+ COPY requirements.txt /tmp/requirements.txt
47+
48+ # Install Python packages from requirements.txt
49+ RUN pip3 install -r /tmp/requirements.txt
50+
51+ # Install E2B CLI
52+ RUN npm install -g @e2b/cli@latest
53+
54+ # Install additional Python packages
55+ RUN pip install e2b_code_interpreter
56+ RUN pip install litellm
57+ RUN pip install gradio
58+
59+ # Ensure Jupyter is installed and configured
60+ RUN pip3 install jupyter
61+
62+ # Create necessary Jupyter directories and files
63+ RUN mkdir -p /root/.jupyter && \
64+ echo "c.NotebookApp.ip = '0.0.0.0'" > /root/.jupyter/jupyter_notebook_config.py
65+
66+ # Ensure Jupyter kernel is properly set up
67+ RUN yes | jupyter notebook --generate-config && \
68+ jupyter kernelspec list
69+
70+ # Set the entrypoint to bash for interactive use
71+ ENTRYPOINT ["/bin/bash" ]
0 commit comments