From e38391e1e184418a72d407afbceaf2329d69d3f2 Mon Sep 17 00:00:00 2001
From: Tarraann <jot.taran15522@gmail.com>
Date: Thu, 31 Aug 2023 16:29:16 +0530
Subject: [PATCH 1/6] Docker digitalocean deployment

---
 .do/app.yaml             | 77 ++++++++++++++++++++++++++++++++++++++++
 .do/deploy.template.yaml | 74 ++++++++++++++++++++++++++++++++++++++
 Dockerfile               |  4 +--
 3 files changed, 153 insertions(+), 2 deletions(-)
 create mode 100644 .do/app.yaml
 create mode 100644 .do/deploy.template.yaml

diff --git a/.do/app.yaml b/.do/app.yaml
new file mode 100644
index 000000000..a4b21ec93
--- /dev/null
+++ b/.do/app.yaml
@@ -0,0 +1,77 @@
+alerts:
+  - rule: DEPLOYMENT_FAILED
+  - rule: DOMAIN_FAILED
+databases:
+  - engine: PG
+    name: super-agi-main
+    num_nodes: 1
+    size: basic-xs
+    version: "12"
+ingress:
+  rules:
+    - component:
+        name: superagi-backend
+      match:
+        path:
+          prefix: /api
+name: superagi
+region: blr
+services:
+  - dockerfile_path: DockerfileRedis
+    github: 
+      branch: digitalocean-deployment
+      deploy_on_push: true
+      repo: TransformerOptimus/SuperAGI
+    internal_ports: 
+    - 6379
+    instance_count: 1
+    instance_size_slug: basic-xs
+    source_dir: /
+    name: superagi-redis
+  - dockerfile_path: Dockerfile
+    envs:
+      - key: REDIS_URL
+        scope: RUN_TIME
+        value: superagi-redis:6379
+      - key: DB_URL
+        scope: RUN_TIME
+        value: ${super-agi-main.DATABASE_URL}
+    github:
+      branch: digitalocean-deployment
+      deploy_on_push: true
+      repo: TransformerOptimus/SuperAGI
+    http_port: 8001
+    instance_count: 1
+    instance_size_slug: basic-xs
+    run_command: /app/entrypoint.sh
+    source_dir: /
+    name: superagi-backend
+  - dockerfile_path: ./gui/DockerfileProd
+    github:
+      branch: main
+      deploy_on_push: true
+      repo: TransformerOptimus/SuperAGI
+    http_port: 3000
+    instance_count: 1
+    instance_size_slug: basic-xs
+    source_dir: ./gui
+    name: superagi-gui
+workers:
+  - dockerfile_path: Dockerfile
+    envs:
+      - key: REDIS_URL
+        scope: RUN_TIME
+        value: superagi-redis:6379
+      - key: DB_URL
+        scope: RUN_TIME
+        value: ${super-agi-main.DATABASE_URL}
+    github:
+      branch: digitalocean-deployment
+      deploy_on_push: true
+      repo: TransformerOptimus/SuperAGI
+    instance_count: 1
+    instance_size_slug: basic-xs
+    run_command: celery -A superagi.worker worker --beat --loglevel=info
+    source_dir: /
+    name: superagi-celery
+  
\ No newline at end of file
diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml
new file mode 100644
index 000000000..0112da462
--- /dev/null
+++ b/.do/deploy.template.yaml
@@ -0,0 +1,74 @@
+spec:
+  alerts:
+    - rule: DEPLOYMENT_FAILED
+    - rule: DOMAIN_FAILED
+  databases:
+    - engine: PG
+      name: super-agi-main
+      num_nodes: 1
+      size: basic-xs
+      version: "12"
+  ingress:
+    rules:
+      - component:
+          name: superagi-backend
+        match:
+          path:
+            prefix: /api
+  name: superagi
+  region: blr
+  services:
+    - dockerfile_path: DockerfileRedis
+      git:
+        branch: digitalocean-deployment
+        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
+      internal_ports: 
+      - 6379
+      instance_count: 1
+      instance_size_slug: basic-xs
+      source_dir: /
+      name: superagi-redis
+    - dockerfile_path: Dockerfile
+      envs:
+        - key: REDIS_URL
+          scope: RUN_TIME
+          value: superagi-redis:6379
+        - key: DB_URL
+          scope: RUN_TIME
+          value: ${super-agi-main.DATABASE_URL}
+      git:
+        branch: digitalocean-deployment
+        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
+      http_port: 8001
+      instance_count: 1
+      instance_size_slug: basic-xs
+      run_command: /app/entrypoint.sh
+      source_dir: /
+      name: superagi-backend
+    - dockerfile_path: ./gui/DockerfileProd
+      git:
+        branch: main
+        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
+      http_port: 3000
+      instance_count: 1
+      instance_size_slug: basic-xs
+      source_dir: ./gui
+      name: superagi-gui
+  workers:
+    - dockerfile_path: Dockerfile
+      envs:
+        - key: REDIS_URL
+          scope: RUN_TIME
+          value: superagi-redis:6379
+        - key: DB_URL
+          scope: RUN_TIME
+          value: ${super-agi-main.DATABASE_URL}
+      git:
+        branch: digitalocean-deployment
+        repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
+      instance_count: 1
+      instance_size_slug: basic-xs
+      run_command: celery -A superagi.worker worker --beat --loglevel=info
+      source_dir: /
+      name: superagi-celery
+    
diff --git a/Dockerfile b/Dockerfile
index 420f68cad..057970569 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 # Stage 1: Compile image
-FROM python:3.10-slim-bullseye AS compile-image
+FROM python:3.10-bullseye AS compile-image
 WORKDIR /app
 
 RUN apt-get update && \
@@ -20,7 +20,7 @@ COPY . .
 RUN chmod +x ./entrypoint.sh ./wait-for-it.sh ./install_tool_dependencies.sh ./entrypoint_celery.sh
 
 # Stage 2: Build image
-FROM python:3.10-slim-bullseye AS build-image
+FROM python:3.10-bullseye AS build-image
 WORKDIR /app
 
 RUN apt-get update && \

From 256c97726adc7c614d871affc9672ba7244d05bc Mon Sep 17 00:00:00 2001
From: Tarraann <jot.taran15522@gmail.com>
Date: Thu, 31 Aug 2023 16:31:13 +0530
Subject: [PATCH 2/6] changed branch name

---
 .do/app.yaml             | 6 +++---
 .do/deploy.template.yaml | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.do/app.yaml b/.do/app.yaml
index a4b21ec93..0f3e9112b 100644
--- a/.do/app.yaml
+++ b/.do/app.yaml
@@ -19,7 +19,7 @@ region: blr
 services:
   - dockerfile_path: DockerfileRedis
     github: 
-      branch: digitalocean-deployment
+      branch: main
       deploy_on_push: true
       repo: TransformerOptimus/SuperAGI
     internal_ports: 
@@ -37,7 +37,7 @@ services:
         scope: RUN_TIME
         value: ${super-agi-main.DATABASE_URL}
     github:
-      branch: digitalocean-deployment
+      branch: main
       deploy_on_push: true
       repo: TransformerOptimus/SuperAGI
     http_port: 8001
@@ -66,7 +66,7 @@ workers:
         scope: RUN_TIME
         value: ${super-agi-main.DATABASE_URL}
     github:
-      branch: digitalocean-deployment
+      branch: main
       deploy_on_push: true
       repo: TransformerOptimus/SuperAGI
     instance_count: 1
diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml
index 0112da462..acbfa23fd 100644
--- a/.do/deploy.template.yaml
+++ b/.do/deploy.template.yaml
@@ -20,7 +20,7 @@ spec:
   services:
     - dockerfile_path: DockerfileRedis
       git:
-        branch: digitalocean-deployment
+        branch: main
         repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
       internal_ports: 
       - 6379
@@ -37,7 +37,7 @@ spec:
           scope: RUN_TIME
           value: ${super-agi-main.DATABASE_URL}
       git:
-        branch: digitalocean-deployment
+        branch: main
         repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
       http_port: 8001
       instance_count: 1
@@ -64,7 +64,7 @@ spec:
           scope: RUN_TIME
           value: ${super-agi-main.DATABASE_URL}
       git:
-        branch: digitalocean-deployment
+        branch: main
         repo_clone_url: https://github.com/TransformerOptimus/SuperAGI.git
       instance_count: 1
       instance_size_slug: basic-xs

From ea5175fa57fe04b9558bc128f7b967e131f853ec Mon Sep 17 00:00:00 2001
From: Tarraann <jot.taran15522@gmail.com>
Date: Thu, 31 Aug 2023 17:28:21 +0530
Subject: [PATCH 3/6] changes

---
 Dockerfile      | 4 ++--
 DockerfileRedis | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 DockerfileRedis

diff --git a/Dockerfile b/Dockerfile
index 057970569..420f68cad 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 # Stage 1: Compile image
-FROM python:3.10-bullseye AS compile-image
+FROM python:3.10-slim-bullseye AS compile-image
 WORKDIR /app
 
 RUN apt-get update && \
@@ -20,7 +20,7 @@ COPY . .
 RUN chmod +x ./entrypoint.sh ./wait-for-it.sh ./install_tool_dependencies.sh ./entrypoint_celery.sh
 
 # Stage 2: Build image
-FROM python:3.10-bullseye AS build-image
+FROM python:3.10-slim-bullseye AS build-image
 WORKDIR /app
 
 RUN apt-get update && \
diff --git a/DockerfileRedis b/DockerfileRedis
new file mode 100644
index 000000000..04624e797
--- /dev/null
+++ b/DockerfileRedis
@@ -0,0 +1 @@
+FROM redis/redis-stack-server:latest
\ No newline at end of file

From 2419bc3e350aa8528e7dcafbf163a0da66a7f381 Mon Sep 17 00:00:00 2001
From: Tarraann <jot.taran15522@gmail.com>
Date: Thu, 31 Aug 2023 17:35:25 +0530
Subject: [PATCH 4/6] removed region

---
 .do/app.yaml             | 7 +++----
 .do/deploy.template.yaml | 1 -
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/.do/app.yaml b/.do/app.yaml
index 0f3e9112b..0e22832a9 100644
--- a/.do/app.yaml
+++ b/.do/app.yaml
@@ -15,11 +15,10 @@ ingress:
         path:
           prefix: /api
 name: superagi
-region: blr
 services:
   - dockerfile_path: DockerfileRedis
     github: 
-      branch: main
+      branch: digitalocean-deployment
       deploy_on_push: true
       repo: TransformerOptimus/SuperAGI
     internal_ports: 
@@ -37,7 +36,7 @@ services:
         scope: RUN_TIME
         value: ${super-agi-main.DATABASE_URL}
     github:
-      branch: main
+      branch: digitalocean-deployment
       deploy_on_push: true
       repo: TransformerOptimus/SuperAGI
     http_port: 8001
@@ -66,7 +65,7 @@ workers:
         scope: RUN_TIME
         value: ${super-agi-main.DATABASE_URL}
     github:
-      branch: main
+      branch: digitalocean-deployment
       deploy_on_push: true
       repo: TransformerOptimus/SuperAGI
     instance_count: 1
diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml
index acbfa23fd..18ffa82dd 100644
--- a/.do/deploy.template.yaml
+++ b/.do/deploy.template.yaml
@@ -16,7 +16,6 @@ spec:
           path:
             prefix: /api
   name: superagi
-  region: blr
   services:
     - dockerfile_path: DockerfileRedis
       git:

From b7e3b5ace8d75855b91e7e94eafb774e6a6ae30c Mon Sep 17 00:00:00 2001
From: Tarraann <jot.taran15522@gmail.com>
Date: Thu, 31 Aug 2023 17:51:53 +0530
Subject: [PATCH 5/6] added button

---
 README.MD | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/README.MD b/README.MD
index 16bb5a6f5..7a4c3ca9f 100644
--- a/README.MD
+++ b/README.MD
@@ -87,6 +87,10 @@
 <a href="https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=640182997&machine=basicLinux32gb&location=EastUs"> <img src="https://github.com/codespaces/badge.svg"></a><br>Not sure how to setup? <a href="https://youtu.be/yvmNthyWYCE">Learn here</a>
 </p>
 
+<br>
+<p align="center">
+<a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/TransformerOptimus/SuperAGI/tree/digitalocean-deployment"> <img src="https://www.deploytodo.com/do-btn-blue.svg"></a><br>Deploy SuperAGI to DigitalOcean with one click.
+</p>
 
 ## 💡 Features
 

From e493034e82d7f3be79e92106880a6d7c311c826b Mon Sep 17 00:00:00 2001
From: Tarraann <jot.taran15522@gmail.com>
Date: Thu, 31 Aug 2023 17:52:31 +0530
Subject: [PATCH 6/6] change in branch

---
 README.MD | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.MD b/README.MD
index 7a4c3ca9f..224ce2d0a 100644
--- a/README.MD
+++ b/README.MD
@@ -89,7 +89,7 @@
 
 <br>
 <p align="center">
-<a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/TransformerOptimus/SuperAGI/tree/digitalocean-deployment"> <img src="https://www.deploytodo.com/do-btn-blue.svg"></a><br>Deploy SuperAGI to DigitalOcean with one click.
+<a href="https://cloud.digitalocean.com/apps/new?repo=https://github.com/TransformerOptimus/SuperAGI/tree/main"> <img src="https://www.deploytodo.com/do-btn-blue.svg"></a><br>Deploy SuperAGI to DigitalOcean with one click.
 </p>
 
 ## 💡 Features