You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.8 KiB

11 months ago
  1. resources:
  2. - name: anything-llm-instance
  3. type: compute.v1.instance
  4. properties:
  5. zone: us-central1-a
  6. machineType: zones/us-central1-a/machineTypes/n1-standard-1
  7. disks:
  8. - deviceName: boot
  9. type: PERSISTENT
  10. boot: true
  11. autoDelete: true
  12. initializeParams:
  13. sourceImage: projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts
  14. diskSizeGb: 10
  15. networkInterfaces:
  16. - network: global/networks/default
  17. accessConfigs:
  18. - name: External NAT
  19. type: ONE_TO_ONE_NAT
  20. metadata:
  21. items:
  22. - key: startup-script
  23. value: |
  24. #!/bin/bash
  25. # check output of userdata script with sudo tail -f /var/log/cloud-init-output.log
  26. sudo apt-get update
  27. sudo apt-get install -y docker.io
  28. sudo usermod -a -G docker ubuntu
  29. sudo systemctl enable docker
  30. sudo systemctl start docker
  31. mkdir -p /home/anythingllm
  32. touch /home/anythingllm/.env
  33. sudo chown -R ubuntu:ubuntu /home/anythingllm
  34. sudo docker pull mintplexlabs/anythingllm
  35. sudo docker run -d -p 3001:3001 --cap-add SYS_ADMIN -v /home/anythingllm:/app/server/storage -v /home/anythingllm/.env:/app/server/.env -e STORAGE_DIR="/app/server/storage" mintplexlabs/anythingllm
  36. echo "Container ID: $(sudo docker ps --latest --quiet)"
  37. export ONLINE=$(curl -Is http://localhost:3001/api/ping | head -n 1|cut -d$' ' -f2)
  38. echo "Health check: $ONLINE"
  39. echo "Setup complete! AnythingLLM instance is now online!"