do_provision {plumber} | R Documentation |
Create (if required), install the necessary prerequisites, and deploy a sample plumber application on a DigitalOcean virtual machine. This command is idempotent, so feel free to run it on a single server multiple times.
do_provision(droplet, unstable = FALSE, example = TRUE, ...)
droplet |
The DigitalOcean droplet that you want to provision (see |
unstable |
If |
example |
If |
... |
Arguments passed into the |
Provisions a Ubuntu 16.04-x64 droplet with the following customizations:
A recent version of R installed
plumber installed globally in the system library
An example plumber API deployed at /var/plumber
A systemd definition for the above plumber API which will ensure that the plumber
API is started on machine boot and respawned if the R process ever crashes. On the
server you can use commands like systemctl restart plumber
to manage your API, or
journalctl -u plumber
to see the logs associated with your plumber process.
The 'nginx“ web server installed to route web traffic from port 80 (HTTP) to your plumber process.
ufw
installed as a firewall to restrict access on the server. By default it only
allows incoming traffic on port 22 (SSH) and port 80 (HTTP).
A 4GB swap file is created to ensure that machines with little RAM (the default) are able to get through the necessary R package compilations.