2 analysis.yml
2.1 The script
- Adds CRAN and Docker APT sources
- Installs packages for:
- Python (pip, libraries)
- R (base, dev tools, packages)
- Installs Docker and Docker Compose
- Add security (fail2ban, ufw)
- Creates a user piet with sudo and Docker access
- Configures SSH on port 4444
- Saves a log as /var/log/cloud-init-output.log
- Sets up fail2ban and a firewall
- Installs Python and R packages
- Optionally adds swap space for R
- Installs a large set of R packages
- Installs Node.js for JavaScript-based services
- Installs npm for JavaScript package management
- Installs Express.js generator
- Creates a simple marker file to verify cloud-init completion
2.2 References
Help on cloud-init syntax from:
https://cloudinit.readthedocs.io/en/latest/topics/examples.html
-
- ERROR: THE
ssh-authorized-keys(ANDsudo) SYNTAX IS WRONG IN ALL DIGITAL OCEAN EXAMPLES, SEE NEXT REFERENCE
- ERROR: THE
Help on R and Docker installation syntax from:
http://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/
https://www.digitalocean.com/community/tutorials/how-to-set-up-r-on-ubuntu-14-04
https://gist.github.com/mdlincoln/1f40f4e88ce32c55b5f3#gistcomment-3009981
https://cran.rstudio.com/bin/linux/ubuntu/fullREADME.html#using-apt-key
https://github.com/rocker-org/hadleyverse/blob/master/Dockerfile
https://stackoverflow.com/questions/24418815/how-do-i-install-docker-using-cloud-init
Detailed explanations of lines of code for Node.js setup:
git: Essential for version control and cloning repositories.nodejsandnpm: Required for running and managing JavaScript packages.npm install -g npm@latest: Ensures you’re using the latest npm version, which can fix bugs and improve compatibility.express-generator: A helpful tool for quickly scaffolding Express.js applications.