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.
Dockerfile 71%
26%
R 3%
README.md
r_python_docker_template #
This repository is a template for creating a Dockerized development environment that includes the latest versions of Python and R, along with RStudio Server. It is designed to facilitate mixed-language projects and make development easier and more reproducible.
Getting Started #
Prerequisites #
- Docker
- Visual Studio Code
- Remote - Containers Extension for VS Code
Setup #
-
Clone this repository:
git clone https://github.com/gbocsardi/r_python_docker_template.git cd r_python_docker_template -
Build container:
docker build -t python-r-env --platform linux/amd64 .
- Run the container manually:
docker run --platform linux/amd64 -it --rm \
-v $(pwd)/data:/workspace/data \
-v $(pwd)/code:/workspace/code \
-p 8787:8787 \
-p 8888:8888 \
python-r-env
Usage #
Make sure your container is running!
VS Code for Python #
- Open VS Code, and hit CMD+Shift+P to open the command palette.
- Seach for "Dev Containers: Attach to Running Container..."
- From the opened context menu select your container.
- You're in your
workspacedirectory, the parent directory ofcode/anddata/.
RStudio Server for R #
- You can access RStudio Server at
http://localhost:8787. - Login credentials are
rstudiofor both username and password (without quotes). - You're in your
workspacedirectory, the parent directory ofcode/anddata/.
Jupyter Notebook #
- You can access Jupyter Notebook at
http://localhost:8888. - The access credentials are disabled in the
supervisord.conffile. You can enable it by removing the--NotebookApp.token=''and--NotebookApp.password=''flag from thesupervisord.conffile.
Customization #
- Adding Python Packages: Update the
requirements.txtfile with the required packages. - Adding R Packages: Update the
install_packages.Rfile with the required packages.
On Windows (UNTESTED) #
Delete the --platform linux/amd64 flag from the docker run command.
Delete the below from the devcontainer.json file:
"options": [
"--platform=linux/amd64"
]