Farmbot-Web-App/DEPLOYMENT.md
2016-09-13 09:53:23 -05:00

1.9 KiB

Deployment

  1. Create a fresh Ubuntu 16 server with Dokku (or just use DigitalOcean)
  • Make sure you have atleast 1gb.
  1. Install the latest version of Dokku (don't use that DigitalOcean image)
  2. Visit the server's URL in a browser. Follow the directions on screen to setup Dokku.
  3. git remote add my_server dokku@your-server:my-api-name
  4. Install mariaDB plugin: instructions.
  5. Create the Dokku app. ssh dokku@your-server apps:create my-api-name.
  6. Give Dokku a place to store RSA keys: ssh dokku@your-server storage:mount my-api-name /var/lib/dokku/data/keys:/keys.
  7. Create a databse: ssh dokku@your-server mariadb:create my_db
  8. Link the DB: ssh dokku@your-server mariadb:link my_db my-api-name
  9. Set ENV vars (Set JS\_FILE\_URL and MQTT_HOST to real values):
  • ssh dokku@your-server config:set my-api-name DEVISE_SECRET=$(rake secret) JS_FILE_URL=//mycdn.org/farmbot-fronted.js MQTT_HOST=my-mqtt-server.org
  1. Deploy the app: git push dokku@your-server:my-api-name master
  2. Migrate the database: ssh dokku@your-server run my-api-name rake db:setup
  3. Your API is ready to go! You probably need to deploy the MQTT server next.

Old / Legacy Setup

(Added Sept. 2016)

No longer used, but possibly relevant for those running legacy servers.

  1. Create a fresh Ubuntu 14 server with Dokku (or just use DigitalOcean)
  2. Upgrade to the latest version of Dokku (especially if you are on DigitalOcean- their version is out of date)
  3. Install dokku-haproxy plugin: ssh root@YOUR_SERVER dokku plugin:install https://github.com/256dpi/dokku-haproxy.git
  4. Deploy: git push dokku@YOUR_SERVER:mqtt
  5. Point to correct host/port: ssh dokku@MQTT_SERVER config:set mqtt PORT=3002 DOKKU_NGINX_PORT=3002 WEB_APP_URL=WEBAPP_URL_HERE
  6. Expose MQTT port: ssh dokku@MQTT_SERVER ports:add mqtt 1883 web 1883