Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/agbocsardi/r_python_docker_template. This is my template for projects where I have to use both R and Python, and want to dockerize my environment.
Something went wrong. Try again.
r_python_docker_template Dockerfile
1.5 kB · 61 lines
Dockerfile
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061FROM ubuntu:22.04
USER root
ENV DEBIAN_FRONTEND noninteractive
## INSTALL RRUN apt update -y \ && apt upgrade -y \ && apt install -y \ software-properties-common \ dirmngr \ gnupg2 \ wget
RUN wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc \ | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc \ && add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" \ && apt-get update -y \ && apt-get install -y r-base
# Install RStudio Server for Ubuntu 22.04RUN wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2023.09.0-463-amd64.deb && \ apt-get install -y gdebi-core && \ gdebi -n rstudio-server-2023.09.0-463-amd64.deb && \ rm rstudio-server-2023.09.0-463-amd64.deb
EXPOSE 8787
RUN useradd -m -s /bin/bash -d /home/rstudio rstudio && \ echo "rstudio:rstudio" | chpasswd && adduser rstudio sudo
# install pythonRUN apt-get install -y python3 python3-pip python3-dev python3-venv
# # Install Python packagesWORKDIR /workspace
COPY requirements.txt /workspace/RUN pip3 install --no-cache-dir -r requirements.txt
COPY install_packages.R /workspace/RUN Rscript install_packages.R
# CMD /usr/lib/rstudio-server/bin/rserver --server-daemonize=0
# Install supervisordRUN apt-get install -y supervisor
# Copy supervisord configuration fileCOPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose Jupyter Notebook portEXPOSE 8888
CMD ["/usr/bin/supervisord"]