Dreamcanvas is a project to deploy self-hosted AI, specifically Stable Diffusion, in the cloud using AWS EKS. This repository contains all necessary configurations, including Docker, Kubernetes, Helm charts, and Terraform scripts to set up and manage the infrastructure.
Before you begin, ensure you have the following installed:
Follow these steps to set up and run the project.
git clone https://github.com/semperfitodd/dreamcanvas.git
cd dreamcanvascd static-site
npm install
npm run buildUpdate the terraform/terraform.tfvars file with your specific configurations:
company = "dreamcanvas"
domain = "example.com"
openvpn_instance_type = "t3.micro"
region = "us-east-1"Additionally, update the backend.tf as needed.
This will set up the entire infrastructure including the static website files.
cd terraform
terraform init
terraform applyLogin to ECR
aws ecr get-login-password --region <AWS_REGION>| docker login --username AWS --password-stdin <AWS_ACCOUNT>.dkr.ecr.<AWS_REGION>.amazonaws.comAdd your Huggingface token to docker/stablediffusion/token.txt, then build and push the Docker image to ECR.
cd docker/stablediffusion
docker build -t <AWS_ACCOUNT>.dkr.ecr.<AWS_REGION>.amazonaws.com/dreamcanvas_stablediffusion:0 .
docker push <AWS_ACCOUNT>.dkr.ecr.<AWS_REGION>.amazonaws.com/dreamcanvas_stablediffusion:0
Build the flask API
cd docker/flask
docker build -t <AWS_ACCOUNT>.dkr.ecr.<AWS_REGION>.amazonaws.com/dreamcanvas_flaskapp:0 .
docker push <AWS_ACCOUNT>.dkr.ecr.<AWS_REGION>.amazonaws.com/dreamcanvas_flaskapp:0-
Use SSM to
Connectto the instance terminalsudo -i
-
Run through OpenVPN setup
-
Record initial admin password
-
Setup LetsEncrypt certificate for SSL (optional)
-
Login to admin console
-
Setup new users (optional)
-
Add VPC CIDR block under
Specify the private subnets to which all clients should be given access (one per line): -
Save changes and restart server
Connect to your EKS cluster and deploy ArgoCD. Everything is nested, so running the following in the master directory will deploy everything:
cd k8s/master
helm template . | kubectl apply -f -ArgoCD will manage itself and other applications.
-
Docker: Ensure
token.txtcontains your Huggingface token. -
Kubernetes:
values.yamlin both master and application directories need to be updated with your configurations. -
Terraform:
terraform.tfvarsis the primary file to configure your company, domain, instance type, and region.



