Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 2.01 KB

File metadata and controls

53 lines (34 loc) · 2.01 KB

Deploying Bluflare to DigitalOcean

Want to deploy to DigitalOcean? Use the terraform and ansible files in this directory to deploy Bluflare.

Prerequisites

  • Install OpenTofu or Terraform
  • Install Ansible
  • Get a DigitalOcean API token with read/write access and save it in the TF_VAR_DO_TOKEN environment variable (both terraform and ansible will use this variable)
  • Create an SSH key on your local machine in the ~/.ssh/id_ed25519.pub file (both terraform and ansible will use this file)

Setup

Make sure the DigitalOcean terraform provider is installed.

terraform -chdir=terraform init

Provision

Depending if you have OpenTofu or Terraform, replace tofu with terraform in the commands below. This will provision the necessary cloud resources in DigitalOcean.

tofu -chdir=terraform apply

Setup host

Using ansible and the following command will setup the host to run the Bluflare.

  • To setup the host you need multiple environment variables set. Please refer to the .env.example file for more information.
  • To pull the images you need to have GHCR_USER (your GitHub username) and GHCR_TOKEN (your GitHub token) set in your environment. Please refer to the Github Container Registry documentation for more information to authenticate.
ansible-playbook -i ansible/inv.digitalocean.yaml ansible/setup.yaml

Execute Bluflare

Using ansible and the following command will deploy the Bluflare (pull images and run docker compose).

ansible-playbook -i ansible/inv.digitalocean.yaml ansible/execute.yaml

Teardown

Using terraform and the following command will teardown the cloud resources.

tofu -chdir=terraform destroy