Skip to content
Snippets Groups Projects
Commit 33d05ab2 authored by Lei Xiao's avatar Lei Xiao
Browse files

new file: dockerfile

parent 08a3b0fe
No related merge requests found
# Use Jupyter's official container as base image
FROM jupyter/base-notebook:latest
# Set the working directory in the container
WORKDIR /app
# Copy the contents of the binder directory into the container
COPY binder /tmp/binder
# Install all modules required for package installation in Ubuntu
RUN apt-get update && \
apt-get install -y --no-install-recommends $(cat /tmp/binder/apt.txt) && \
rm -rf /var/lib/apt/lists/*
# Install Conda and create a conda environment called "d2s"
RUN conda create --name d2s python=3.9 -y
# Activate the "d2s" conda environment
SHELL ["conda", "run", "-n", "d2s", "/bin/bash", "-c"]
# Install Python packages listed in requirements.txt
COPY binder/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Install R version specified in the runtime.txt and R packages listed in install.R
COPY binder/runtime.txt /tmp/runtime.txt
COPY binder/install.R /tmp/install.R
RUN Rscript /tmp/install.R
# Install IRkernel and IPykernel
RUN conda install -c conda-forge r-irkernel -y
RUN conda install ipykernel -y
# Copy Jupyter notebooks, data, results, and scripts into the container
COPY ./*.ipynb /app/
COPY data /app/data
COPY results /app/results
COPY scripts /app/scripts
# Configure Jupyter notebook port and command
EXPOSE 8888
# Start Jupyter Notebook server
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--allow-root"]
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment