ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co
https://gauzy.co
GNU Affero General Public License v3.0
2.07k stars 497 forks source link

[DevOps] Make it possible to deploy to DigitalOcean App Platform and Droplets #7589

Open evereq opened 4 months ago

evereq commented 4 months ago

Droplets

DigitalOcean App Platform

evereq commented 4 months ago

https://github.com/ever-co/ever-gauzy/pull/7591

evereq commented 4 months ago

Setup on Droplets

  1. Create 3 separate Droplets for each env, e.g. ever-do-demo, ever-do-stage, and ever-do-prod. Make sure each Droplet is at least 2GB RAM.
  2. Set GitHub Secrets DO_DROPLET_DEMO_HOST, DO_DROPLET_STAGE_HOST and DO_DROPLET_PROD_HOST to values of IPs of your relevant Droplets
  3. Add Droplet names to Trusted sources for Redis and PostgreSQL DB
  4. Define GitHub Secrets DO_DROPLET_USERNAME (default value in DO is root) and DO_DROPLET_KEY (use SSH Private key that used when you added public SSH Key to DO)
evereq commented 4 months ago

Setup on the DigitalOcean App Platform

  1. Make sure GitHub Secret DIGITALOCEAN_ACCESS_TOKEN is set to your DigitalOcean access token that has enough privileges to create/update DigitalOcean App Platform applications.
  2. Our existing GitHub actions are used to create 3 separate "Apps" in DigitalOcean, one for each environment, e.g. ever-gauzy-demo, ever-gauzy-stage and ever-gauzy-prod
  3. Check .github/workflows/deploy-do-app-platform-demo.yml, .github/workflows/deploy-do-app-platform-stage.yml and .github/workflows/deploy-do-app-platform-prod.yml
  4. Each GitHub action creates or updates a separate DO App and assigns a custom Domain name to each env (see APP_DOMAIN env var)
  5. You can define the type of instance (size) in the INSTANCE_SIZE env var (see possible values in the following link) and count in the INSTANCE_COUNT env var. We recommend using 1 instance in the demo env and at least 2 instances in the stage env. Make sure you are using a professional instance size and at least 2 instances for prod environment.
  6. Important to make sure DEMO env var is set to false for prod environment. We also recommend to set ADMIN_PASSWORD_RESET to false for production.
  7. As with any other setup of our platform, make sure API_BASE_URL is set to the URL on which you would like to have API exposed and CLIENT_BASE_URL should be set to the URL on which you will have client-side UI loaded.
  8. You can also research .do/app.yaml file that is used as a template to define the DO App Platform application. Important to note that you will have to configure services/image/registry_type ,services/image/registry, and services/image/repository to use your own DigitalOcean or DockerHub Container Registry, please refer to DO documentation about those parameters.
evereq commented 3 months ago

Added Wiki https://github.com/ever-co/ever-gauzy/wiki/Gauzy-Self%E2%80%90Hosted-Setup-in-DigitalOcean