Skip to content

Latest commit

 

History

History
45 lines (24 loc) · 2.97 KB

README.md

File metadata and controls

45 lines (24 loc) · 2.97 KB

Oceancloud

Oceancloud is an automated and distributed Nextcloud deployment on Digital Ocean, provisioned by Terraform. It leverages Digital Ocean's managed database service, abstracted block storage for persistent data, and a simple and immutable docker droplet running the official Nextcloud container, which bootstraps itself to the database and block storage.

Requirements

Docker. That's it!

How To:

1. Copy your Digital Ocean access token into the allocated variables at the top of each of the following:

DO NOT commit your access token to source control for security measures

2. Set your desired variables for the Digital Ocean resources in terraform/terraform.tfvars

3. Run make nextcloud

After successfully creating the required resources, an output of the load balancer's IP and database information will be printed to the console.

4. In a browser, navigate to the IP address, create your admin account, and add the database info from the aforementioned output.

Be sure to select PostgresSQL on the setup

nextcloudsetup

5. Enjoy your new micro-service deployment of Nextcloud!

Using Terraform Remote Backend (recommended)

I recommend using a Terraform remote backend to remotely store the state of the deployment. This ensures that Terraform's state remains persistent regardless of your local repo.

There is a already a place holder to insert your backend config (terraform/backend_config.tf)

Upgrading Nextcloud

Since the app itself is a simple and immutable docker image, simply destroy the droplet and re-run make nextcloud. Terraform will detect that the deployment is not in its desired state (since the droplet is now missing) and recreate it, pulling the latest Nextcloud image.

What's happening under the hood

cloudcraftdiagram

The main advantage of this architecture is that both the database and persistent data are both abstracted from the docker host. The database is provisioned and managed by Digital Ocean, and the persistent data is abstracted and mapped to a separate block storage device via dostorage. The Docker droplet now simply pulls and runs the latest stable Nextcloud image, making it completely immutable.