This is docker-compose.yml, execute the command: docker compose up -d to run the RStudio Container.
Then open your browser to http://localhost:8787/, you can see the login dialog, please input rstudio/yourpassword to log in.
If you are on the Windows operating system, you must install Docker Desktop first. Every time you want to run Docker commands, you need to execute the Docker Desktop Software first, and then you can execute your Docker commands.
You can see we use a Docker image rocker/rstduio, and we map the local folder ./myproject into the Docker container environment. You can execute the command: docker compose up -d in the same path as the docker-compose.yml file. And open your browser to http://localhost:8787.
version: '3'
services:
rstudio:
image: rocker/rstudio
ports:
- "8787:8787"
environment:
- PASSWORD=yourpassword
volumes:
- ./myproject:/home/rstudio/myproject


Learn how to use Docker will make your development life easier.
If you think it is well written, please forward this article.