Skip to content

Latest commit

 

History

History
144 lines (89 loc) · 6.51 KB

006-support-deploy-to-heroku.md

File metadata and controls

144 lines (89 loc) · 6.51 KB

One Click Deploy to Heroku

Summary

Supporting one click deploy to Heroku right from GitHub, with Appwrite Lite. Which will increase our adoption rate as anyone can click to deploy to Heroku for free and try Appwrite, or even use in in production with less resources.


Heroku and similar platforms are modern day standards for deploying applications. But deploying on such platforms requires certain fundamental architectural decisions made. Supporting these platforms will help make deploying and testing Appwrite easier for beginners. We can even support one click deployment right from Github.

Problem Statement (Step 1)

What problem are you trying to solve?

Deploying to Heroku, with a deploy to Heroku button, right from GitHub readme of Appwrite Lite repo.


Heroku, deploys applications on an ephemeral storage called dynos, where data can be written to disk however those data will not persist after the application is restarted. This provides fundamental challenge to deploy Appwrite, as appwrite uses filesystem storaging and managing things like uploads, functions, config and cache.

Next up, for services like database and redis, there are Heroku Add-ons that can be used, however there is no influxdb/telegraf Add-ons on Heroku.

These problems are limiting the ability of Appwrite to be deployed in Heroku

What is the context or background in which this problem exists?

The current implementation of storage and influxdb/telegraf prevents from deployment to Heroku and make it usable properly.

Once the proposal is implemented, how will the system change?

  • There will be an option to disable influxdb/telegraf stats using environment variable.
  • There will be an option to switch default storages (uploads, configs, cache and functions) to external services like Amazon S3 or Digitalocean Spaces (may be).

Design proposal (Step 2)

Heroku docker configuration

Need to create a Heroku docker configuration file in the Appwrite Lite repo, which will allow us to build and deploy Appwrite Lite docker image easily to Heroku. Reference to heroku docker configuration.

Heroku app configuration

Create a Heroku app configuration file (app.json) in the Appwrite Lite repo which will allow us to support one click deployment to Heroku right from GitHub. Reference to app configuration .

Redis and Mysql add-ons will have to be added in the config. The environment variables for Redis and Mysql connections will have to be updated accordingly in the Heroku docker configuration.

POC

First create a POC of one click deploy to Heroku as it's current state. Even if no data in file system persists, we can use the same idea further once we add support to external storage services like S3.


Introduce new environment variable to disable stats

Should introduce a new environment variable _APP_USAGE_STATS, default value is enabled and can be set to disabled to disable the stats, enabling user to completely drop influxdb/telegraph without any errors. More on this is described in Disable Usage Stats RFC

Introduce external storage support

Should introduce new environment variables for storage service config.

Update documentation

Update documentation to highlight these new options, to integrate external storage service and to disable stats

Tutorial

Create a short totorial on how to disable stats completely and how to integrate external storage service like Amazon S3.

Prior art

Unresolved questions

Future possibilities

This feature will make it easier for beginners to quickly spin up appwrite server and try it or even use it in production with low resource cost.