Newer
Older
# Set noninteractive mode to prevent prompts during installation
pandoc \
libclang-dev \
libpq-dev \
libgit2-dev \
# Create an RStudio user with sudo access
RUN useradd -m -s /bin/bash rstudio && echo "rstudio:rstudio" | chpasswd && \
usermod -aG sudo rstudio
# Set working directory
WORKDIR /root
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
bash miniconda.sh -b -p /opt/miniconda && \
rm miniconda.sh
# Set environment variables for Conda
ENV PATH="/opt/miniconda/bin:$PATH"
# Create .condarc file for channel priority
RUN echo "channels:\n - conda-forge\n - bioconda\n - defaults\n - r" > /root/.condarc
# Create Conda environment and install dependencies
RUN conda create --name neuroestimator -y \
tensorflow-estimator=1.15.1 \
r-keras=2.3.0.0 \
r-tensorflow=2.2.0 \
h5py=2.10.0 \
hdf5=1.10.6 \
r-dplyr=1.0.9 \
r-base \
r-remotes \
# Install RStudio Server
RUN wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2024.12.1-563-amd64.deb -O rstudio-server.deb && \
dpkg -i rstudio-server.deb || apt-get -f install -y && \
rm rstudio-server.deb
# Ensure RStudio uses Conda's R
RUN echo 'export RSTUDIO_WHICH_R="/opt/miniconda/envs/neuroestimator/bin/R"' >> /etc/profile.d/rstudio.sh
# Install NEUROeSTIMator in the Conda environment
RUN conda run -n neuroestimator R -e "remotes::install_git('https://research-git.uiowa.edu/michaelson-lab-public/neuroestimator')"
# Ensure Conda environment is activated on container start
SHELL ["/bin/bash", "-c"]
# Expose RStudio Server port
EXPOSE 8787
ENTRYPOINT ["/bin/bash", "-c", "source activate neuroestimator && /usr/lib/rstudio-server/bin/rserver --server-user=$(whoami) --server-daemonize=0"]