πŸš€ Streamlining RStudio Server with Docker Compose!

 πŸš€ Streamlining RStudio Server with Docker Compose! πŸš€

Are you painful with Rstudio “can’t install library”, “use in different computer”, “different R version”, etc.

From problem I faced, after solving I share!

Remember my previous post about running RStudio Server in Docker?  I have used very long command.

I've found an even more efficient way! 🀩

Instead of wrestling with a lengthy docker run command below every times!

sudo docker run \
    -v /home/namthip:/home/rstudio/namthip \
    -v /home/namthip/R/host-site-library:/usr/local/lib/R/host-site-library \
    -e R_LIBS_USER=/home/namthip/R/host-site-library \
    -e PASSWORD= \
    -p 8787:8787 \
    bioconductor/bioconductor_docker:RELEASE_3_15

✅ Step 1: Create your `docker-compose.yml file`  

However, before that easy step, we have to prepare docker-compose.yml file first. Use information below, save, and named it exactly this docker-compose.yml file. 
version: "3.8"
services:
rstudio:
image: bioconductor/bioconductor_docker:RELEASE_3_15
ports:
- "8787:8787"
volumes:
- /home/namthip:/home/rstudio/namthip
- /home/namthip/R/host-site-library:/usr/local/lib/R/host-site-library
environment:
- R_LIBS_USER=/home/namthip/R/host-site-library
- PASSWORD=<MY_PASSWORD>

✅ Step 2: Launch RStudio Server:

Navigate to the directory where you saved docker-compose.yml. 
Type this to start the container.

sudo docker compose up -d

Now, access RStudio Server by opening your browser and going to `localhost:8787`.

✅ Step 3: Shutting Down:

After finish using it, go to the directory you store docker-compose.yml again.
Then stop docker container by typing.

sudo docker compose down


πŸ“› Don't forget to do this before shutting down your computer!
Docker Compose makes managing multi-container Docker applications a breeze, and it's perfect for simplifying your RStudio Server setup. πŸ’»✨
▶️ Full info via my website: https://lnkd.in/gmTCD4Vp
hashtagDocker hashtagRStudio hashtagDataScience hashtagDockerCompose hashtagR hashtag

Comments

Popular posts from this blog

The Conference To End All Conferences: "Woodstock.Bio2 + Night Science"

Vibe Coding: When everything in coding is thrown to AI πŸ€–