-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sanch3z_Sama
committed
Jul 22, 2024
1 parent
26eb014
commit d90eae1
Showing
1 changed file
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,44 @@ | ||
#Download base image ubuntu 22.04 | ||
FROM ubuntu:22.04 | ||
|
||
# Set root user | ||
USER root | ||
|
||
# Update Ubuntu Software repository and install python, jupyter lab and git | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
sshpass \ | ||
curl \ | ||
python3 \ | ||
python3-pip \ | ||
git \ | ||
jq \ | ||
&& \ | ||
python3 -m pip install --upgrade pip && \ | ||
python3 -m pip install \ | ||
jupyterlab \ | ||
IM-client | ||
IM-client \ | ||
tabulate | ||
|
||
# Install yarn | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ | ||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ | ||
apt-get update && \ | ||
apt-get install -y yarn | ||
|
||
RUN yarn add js-yaml | ||
|
||
# Optional: Clean up package cache to reduce image size | ||
RUN apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Create the script to init jupyter lab | ||
RUN echo "#!/bin/bash" > /bin/jupyter-apricot && \ | ||
echo "jupyter lab --ip 0.0.0.0 --no-browser" >> /bin/jupyter-apricot && \ | ||
chmod +x /bin/jupyter-apricot | ||
RUN mkdir -p /home/apricotlab && \ | ||
git clone https://github.com/grycap/apricotlab /home/apricotlab | ||
|
||
# Create a user for jupyter lab | ||
RUN useradd -ms /bin/bash jupyteruser | ||
# Set the working directory (optional, depending on your needs) | ||
WORKDIR /home/apricotlab/ | ||
|
||
# Change to jupyter lab user | ||
USER jupyteruser | ||
WORKDIR /home/jupyteruser | ||
# Install the Jupyter Notebook extension | ||
RUN pip install -ve . | ||
|
||
# Clone git, install, get the examples and clear files | ||
RUN git clone https://github.com/grycap/apricotlab.git && cd apricotlab && \ | ||
sh install.sh && cd .. && cp -r apricotlab/examples . && mv apricotlab .apricot_git | ||
# Expose port 8888 (default port for Jupyter Lab) | ||
EXPOSE 8888/tcp | ||
|
||
# Set entry point | ||
ENTRYPOINT ["/bin/jupyter-apricot"] | ||
# Command to keep container running and wait for interaction | ||
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"] |