Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dena/dify-google-cloud-terraform
Terraform configuration for deploying Dify on Google Cloud with scalability, high availability, and production-level readiness.
https://github.com/dena/dify-google-cloud-terraform
ai dify generative-ai google-cloud infrastructure llm llmops terraform workflow
Last synced: about 2 months ago
JSON representation
Terraform configuration for deploying Dify on Google Cloud with scalability, high availability, and production-level readiness.
- Host: GitHub
- URL: https://github.com/dena/dify-google-cloud-terraform
- Owner: DeNA
- License: other
- Created: 2024-09-25T02:14:34.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-28T09:52:18.000Z (2 months ago)
- Last Synced: 2024-10-28T12:56:56.704Z (2 months ago)
- Topics: ai, dify, generative-ai, google-cloud, infrastructure, llm, llmops, terraform, workflow
- Language: HCL
- Homepage: https://github.com/langgenius/dify
- Size: 55.7 KB
- Stars: 22
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform for Dify on Google Cloud
![Google Cloud](https://img.shields.io/badge/Google%20Cloud-4285F4?logo=google-cloud&logoColor=white)
![Terraform](https://img.shields.io/badge/Terraform-1.9.5-blue.svg)![Dify GCP Architecture](images/dify-google-cloud-architecture.png)
## Overview
This repository allows you to automatically set up Google Cloud resources using Terraform and deploy Dify in a highly available configuration.## Features
- Serverless hosting
- Auto-scaling
- Data persistence## Prerequisites
- Google Cloud account
- Terraform installed
- gcloud CLI installed
- Required APIs enabled (Serverless VPC Access, Service Networking, etc.)## Configuration
- Set environment-specific values in the `terraform/environments/dev/terraform.tfvars` file.
- Create a GCS bucket to manage Terraform state in advance, and replace "your-tfstate-bucket" in the `terraform/environments/dev/provider.tf` file with the name of the created bucket.## Getting Started
1. Clone the repository:
```sh
git clone https://github.com/DeNA/dify-google-cloud-terraform.git
```2. Initialize Terraform:
```sh
cd terraform/environments/dev
terraform init
```3. Make Artifact Registry repository:
```sh
terraform apply -target=module.registry
```4. Build & push container images:
```sh
cd ../../..
sh ./docker/cloudbuild.sh
```
You can also specify a version of the dify-api image.
```sh
sh ./docker/cloudbuild.sh
```
If no version is specified, the latest version is used by default.5. Terraform plan:
```sh
cd terraform/environments/dev
terraform plan
```6. Terraform apply:
```sh
terraform apply
```## Cleanup
```sh
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
- [Dify](https://dify.ai/)
- [GitHub](https://github.com/langgenius/dify)## License
This software is licensed under the MIT License. See the LICENSE file for more details.