Home

Awesome

Terraform for Dify on Google Cloud

Google Cloud Terraform

Dify GCP Architecture

<a href="./README_ja.md"><img alt="日本語のREADME" src="https://img.shields.io/badge/日本語-d9d9d9"></a>

Overview

This repository allows you to automatically set up Google Cloud resources using Terraform and deploy Dify in a highly available configuration.

Features

Prerequisites

Configuration

Getting Started

  1. Clone the repository:

    git clone https://github.com/DeNA/dify-google-cloud-terraform.git
    
  2. Initialize Terraform:

    cd terraform/environments/dev
    terraform init
    
  3. Make Artifact Registry repository:

    terraform apply -target=module.registry
    
  4. Build & push container images:

    cd ../../..
    sh ./docker/cloudbuild.sh <your-project-id> <your-region>
    

    You can also specify a version of the dify-api image.

    sh ./docker/cloudbuild.sh <your-project-id> <your-region> <dify-api-version>
    

    If no version is specified, the latest version is used by default.

  5. Terraform plan:

    cd terraform/environments/dev
    terraform plan
    
  6. Terraform apply:

    terraform apply
    

Cleanup

terraform destroy

Note: Cloud Storage, Cloud SQL, VPC, and VPC Peering cannot be deleted with the terraform destroy command. These are critical resources for data persistence. Access the console and carefully delete them. After that, use the terraform destroy command to ensure all resources have been deleted.

References

License

This software is licensed under the MIT License. See the LICENSE file for more details.