This is an example Rails Pinterest clone hosted on Akash. There are a few extra features to make the most of decentralised hosting:
Runs the rails server and hosts the actual website.
Connects to the Postgres container for a persistent database.
Uses Auth0 for user login and registration.
Auto-restores the Postgres database on boot, achieving persistent database through re-deploys.
Auto-backup of the database to Filebase every 15 minutes.
Runs the same docker image as the rails application, but running
cron instead of the rails server.
A standalone database backup/restore container is also available.
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:
Setup a free Cloudflare account and add your domain and set nameservers.
Setup a Filebase account and bucket.
backups folder to your bucket.
You will need your bucket name, client ID, and secret.
Deploy on Akash and get your app URL.
Point your domain to your app URL using a CNAME in Cloudflare.
Configure 'Full' SSL mode in Cloudflare.
Sign in to your website using Auth0. The first user created will be made an administrator.
Precompiles rails assets.
Runs the rails server.
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.
.env.sample file to
.env and populate.
docker-compose up to build and run the application.