Go back

Overview of .env file

If you need to customize the configuration, please refer to the comments in .env file and update the required values. Additionally, you might need to make adjustments to the docker-compose.yaml file itself, such as changing image versions, port mappings, or volume mounts, based on your specific deployment environment and requirements. After making any changes, please re-run “docker-compose up -d” as covered in below guide.

  1. The git repo of “DifyAI” is located at /home/ubuntu/setup/ folder on this VM. To access the .env file connect via SSH terminal and change directory using -

Note: If you are on GCP platform then after connecting to SSH terminal make sure to switch to ubuntu user first and then navigate to difyai git repo.

To switch to ubuntu user run -

sudo su ubuntu
cd /home/ubuntu/

/img/gcp/difyai-vm/switch-user.png

Navigating to dify git repo using -

cd /home/ubuntu/setup/dify/docker/

Open file in vi editor using -

sudo vi .env

/img/gcp/difyai-vm/edit-env-file.png

please refer to the comments in this file for any customization you want to make in your Dify Setup and update it accordingly.

Press “i” key to enable insert mode , make changes and save the file by pressing ESC key followed by :wq.

  1. The environment file comes with various storage type configuration used to store uploaded data set files, team/tenant encryption keys, and other files. It includes Opendal, AWS S3, Azure Blob, GCP cloud storage, Alibaba, tencent etc. The configurations are available from line no. 300 onwards.

/img/gcp/difyai-vm/storage-configuration.png

  1. Various Vector Database Configuration is available which supports weaviate, qdrant, milvus, myscale, relyt, pgvector, pgvecto-rs, chroma, opensearch, oracle, tencent. The configurations are available from line 388 onwards.

/img/gcp/difyai-vm/vector-configuration.png

  1. Model Configuration: Used to specify various settings for Models. These settings allow you to customize tokens settings for prompt generation, code generation and plugin based token counting.

/img/gcp/difyai-vm/model-configuration.png

You can explore different options in this .env file and make changes as per your requirements.

  1. After making any changes, please re-run docker-compose command to apply the changes. To do so navigate to directory where docker-compose.yaml file is located.
cd /home/ubuntu/setup/dify/docker/
sudo docker-compose down
sudo docker-compose up -d

/img/gcp/difyai-vm/docker-compose-down.png

/img/gcp/difyai-vm/docker-compose-up.png

Now verify that the new changes are active in your DifyAI setup

For more details, please visit Official Documentation page

Go back