Ruby on Rails with Sia and Auth0
This is an example Rails Pinterest clone hosted on Akash. There are a few extra features to make the most of decentralised hosting:
- Auto-restores the Postgres database on boot, achieving persistent database through re-deploys.
- Runs the same docker image as the rails application, but running
cron
instead of the rails server.
- Runs a standard Postgres server docker image.
Ultimately this repository is designed to provide a sensible example of hosting a rails application on Akash. There are a few ways to use it:
- Add a
backups
folder to your bucket. - You will need your bucket name, client ID, and secret.
- Deploy on Akash and get your app URL.
- Rails ready Dockerfile.
- Precompiles rails assets.
- Runs the rails server.
- Creates and restores the database.
- Runs rake db:migrate and db:seed.
- Restore the DB if a backup was found.
- Deletes backups older than KEEP_BACKUPS.
- Akash deploy manifest.
- Clone the repository to your own Github account.
- Rename any occurrence of AkashOnRails, akash-on-rails and, akash_on_rails to your own app name.
- Change any app/models, app/controllers, app/views as required.
You can run the application locally using Docker compose.
Copy the
.env.sample
file to .env
and populate.Run
docker-compose up
to build and run the application.Last modified 1yr ago