这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ These instructions are for CLI configuration and assume you are logged in to EC2
1. $sudo certbot --nginx -d [Insert FQDN here]
Example command: $sudo certbot --nginx -d anythingllm.exampleorganization.org
This command will generate the appropriate certificate files, write the files to /etc/letsencrypt/live/yourFQDN, and make updates to the nginx
configuration file for anythingllm locdated at /etc/nginx/conf.d/anything.llm
configuration file for anythingllm located at /etc/nginx/conf.d/anything.llm
3. Enter the email address you would like to use for updates.
4. Accept the terms of service.
5. Accept or decline to recieve communication from letsencrypt.
5. Accept or decline to receive communication from LetsEncrypt.

## Step 10: Test Cert installation
1. $sudo cat /etc/nginx/conf.d/anything.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"InstanceType": {
"Description": "EC2 instance type",
"Type": "String",
"Default": "t2.small"
"Default": "t3.small"
},
"InstanceVolume": {
"Description": "Storage size of disk on Instance in GB",
Expand Down Expand Up @@ -83,28 +83,16 @@
"#!/bin/bash\n",
"# check output of userdata script with sudo tail -f /var/log/cloud-init-output.log\n",
"sudo yum install docker -y\n",
"sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose\n",
"sudo chmod +x /usr/local/bin/docker-compose\n",
"sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose\n",
"sudo systemctl enable docker\n",
"sudo systemctl start docker\n",
"sudo yum install git -y\n",
"git clone https://github.com/Mintplex-Labs/anything-llm.git /home/ec2-user/anything-llm\n",
"touch /home/ec2-user/anything-llm/server/storage/anythingllm.db\n",
"cd /home/ec2-user/anything-llm/docker\n",
"cp .env.example .env\n",
"cd ../frontend\n",
"rm -rf .env.production\n",
"cat >> .env.production << \"END\"\n",
"GENERATE_SOURCEMAP=true\n",
"VITE_API_BASE=\"/api\"\n",
"END\n",
"sudo chown ec2-user:ec2-user -R /home/ec2-user/anything-llm\n",
"sudo docker-compose -f /home/ec2-user/anything-llm/docker/docker-compose.yml up -d\n",
"mkdir -p /home/ec2-user/anythingllm\n",
"touch /home/ec2-user/anythingllm/.env\n",
"sudo chown ec2-user:ec2-user -R /home/ec2-user/anythingllm\n",
"docker pull mintplexlabs/anythingllm:master\n",
"docker run -d -p 3001:3001 -v /home/ec2-user/anythingllm:/app/server/storage -v /home/ec2-user/anythingllm/.env:/app/server/.env -e STORAGE_DIR=\"/app/server/storage\" mintplexlabs/anythingllm:master\n",
"echo \"Container ID: $(sudo docker ps --latest --quiet)\"\n",
"export ONLINE=$(curl -Is http://localhost:3001/api/ping | head -n 1|cut -d$' ' -f2)\n",
"echo \"Health check: $ONLINE\"\n",
"if [ \"$ONLINE\" = 200 ] ; then echo \"Running migrations...\" && curl -Is http://localhost:3001/api/migrate | head -n 1|cut -d$' ' -f2; fi\n",
"echo \"Setup complete! AnythingLLM instance is now online!\"\n",
"\n",
"--//--\n"
Expand Down
2 changes: 1 addition & 1 deletion cloud-deployments/digitalocean/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "digitalocean_droplet" "anything_llm_instance" {
image = "ubuntu-22-10-x64"
name = "anything-llm-instance"
region = "nyc3"
size = "s-1vcpu-1gb"
size = "s-2vcpu-2gb"

user_data = templatefile("user_data.tp1", {
env_content = local.formatted_env_content
Expand Down
47 changes: 4 additions & 43 deletions cloud-deployments/digitalocean/terraform/user_data.tp1
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,16 @@ sudo apt-get update
sudo apt-get install -y docker.io
sudo usermod -a -G docker ubuntu

curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

sudo systemctl enable docker
sudo systemctl start docker

sudo apt-get install -y git

git clone https://github.com/Mintplex-Labs/anything-llm.git /home/anything-llm
cd /home/anything-llm/docker

cat >> .env << END
${env_content}
UID="1000"
GID="1000"
NO_DEBUG="true"
END

echo "Set .env file"

cd ../frontend
sudo rm -rf .env.production

sudo cat >> .env.production << END
GENERATE_SOURCEMAP=true
VITE_API_BASE="/api"
END
mkdir -p /home/anythingllm
touch /home/anythingllm/.env

echo "Set .env.production file"

cd ../docker
sudo docker-compose up -d --build
sudo docker pull mintplexlabs/anythingllm:master
sudo docker run -d -p 3001:3001 -v /home/anythingllm:/app/server/storage -v /home/anythingllm/.env:/app/server/.env -e STORAGE_DIR="/app/server/storage" mintplexlabs/anythingllm:master
echo "Container ID: $(sudo docker ps --latest --quiet)"

sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) mkdir -p /app/server/storage /app/server/storage/documents /app/server/storage/vector-cache /app/server/storage/lancedb
echo "Placeholder folders in storage created."

sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) touch /app/server/storage/anythingllm.db
echo "SQLite DB placeholder set."

sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) chown -R anythingllm:anythingllm /app/collector /app/server
echo "File permissions corrected."

export ONLINE=$(curl -Is http://localhost:3001/api/ping | head -n 1|cut -d$' ' -f2)
echo "Health check: $ONLINE"

if [ "$ONLINE" = 200 ]; then
echo "Running migrations..." && curl -Is http://localhost:3001/api/migrate | head -n 1 | cut -d$' ' -f2
fi

echo "Setup complete! AnythingLLM instance is now online!"
2 changes: 1 addition & 1 deletion cloud-deployments/gcp/deployment/DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ gcloud deployment-manager deployments delete anything-llm-deployment
## Please read this notice before submitting issues about your deployment

**Note:**
Your instance will not be available instantly. Depending on the instance size you launched with it can take anywhere from 10-20 minutes to fully boot up.
Your instance will not be available instantly. Depending on the instance size you launched with it can take anywhere from 5-10 minutes to fully boot up.

If you want to check the instances progress, navigate to [your deployed instances](https://console.cloud.google.com/compute/instances) and connect to your instance via SSH in browser.

Expand Down
49 changes: 5 additions & 44 deletions cloud-deployments/gcp/deployment/gcp_deploy_anything_llm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,18 @@ resources:
sudo apt-get update
sudo apt-get install -y docker.io
sudo usermod -a -G docker ubuntu

curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

sudo systemctl enable docker
sudo systemctl start docker

sudo apt-get install -y git

git clone https://github.com/Mintplex-Labs/anything-llm.git /home/anything-llm
cd /home/anything-llm/docker

cat >> .env << END
!SUB::USER::CONTENT!
UID="1000"
GID="1000"
NO_DEBUG="true"
END

echo "Set .env file"

cd ../frontend
sudo rm -rf .env.production

sudo cat >> .env.production << END
GENERATE_SOURCEMAP=true
VITE_API_BASE="/api"
END

echo "Set .env.production file"

cd ../docker
sudo docker-compose up -d --build
mkdir -p /home/anythingllm
touch /home/anythingllm/.env

sudo docker pull mintplexlabs/anythingllm:master
sudo docker run -d -p 3001:3001 -v /home/anythingllm:/app/server/storage -v /home/anythingllm/.env:/app/server/.env -e STORAGE_DIR="/app/server/storage" mintplexlabs/anythingllm:master
Comment on lines +36 to +37

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulling the latest Docker image can lead to unexpected behavior if the latest version introduces breaking changes. It's recommended to pull a specific version of the Docker image to ensure the stability and performance of your application.

Suggested change
sudo docker pull mintplexlabs/anythingllm:master
sudo docker run -d -p 3001:3001 -v /home/anythingllm:/app/server/storage -v /home/anythingllm/.env:/app/server/.env -e STORAGE_DIR="/app/server/storage" mintplexlabs/anythingllm:master
sudo docker pull mintplexlabs/anythingllm:v1.0.0
sudo docker run -d -p 3001:3001 -v /home/anythingllm:/app/server/storage -v /home/anythingllm/.env:/app/server/.env -e STORAGE_DIR="/app/server/storage" mintplexlabs/anythingllm:v1.0.0

echo "Container ID: $(sudo docker ps --latest --quiet)"

sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) mkdir -p /app/server/storage /app/server/storage/documents /app/server/storage/vector-cache /app/server/storage/lancedb
echo "Placeholder folders in storage created."

sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) touch /app/server/storage/anythingllm.db
echo "SQLite DB placeholder set."

sudo docker container exec -u 0 -t $(sudo docker ps --latest --quiet) chown -R anythingllm:anythingllm /app/collector /app/server
echo "File permissions corrected."

export ONLINE=$(curl -Is http://localhost:3001/api/ping | head -n 1|cut -d$' ' -f2)
echo "Health check: $ONLINE"

if [ "$ONLINE" = 200 ]; then
echo "Running migrations..." && curl -Is http://localhost:3001/api/migrate | head -n 1 | cut -d$' ' -f2
fi

echo "Setup complete! AnythingLLM instance is now online!"