Skip to content

zeropsio/recipe-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zerops x Ruby

This is the most bare-bones example of a Ruby Sinatra app running on Zerops — as few gems as possible, just a simple endpoint with connect, read and write to a Zerops PostgreSQL database.

ruby


Deploy on Zerops

You can either click the deploy button to deploy directly on Zerops, or manually copy the import yaml to the import dialog in the Zerops app.

Deploy on Zerops


Recipe features

  • Ruby with Sinatra on a load balanced Zerops Ruby service
  • Zerops PostgreSQL 16 service as database
  • Healthcheck setup example via /status endpoint
  • Utilization of Zerops' built-in environment variables system through dotenv
  • Utilization of Zerops' built-in log management with various log levels

Production vs. development

Base of the recipe is ready for production, the difference comes down to:

  • Use highly available version of the PostgreSQL database (change mode from NON_HA to HA in recipe YAML, db service section)
  • Use at least two containers for the Ruby service to achieve high reliability and resilience (add minContainers: 2 in recipe YAML, api service section)

Further things to think about when running more complex, highly available Ruby production apps on Zerops:

  • Containers are volatile - use Zerops object storage to store your files
  • Use Zerops Redis (KeyDB) for caching, storing sessions and pub/sub messaging
  • Consider using Puma or Unicorn as production-ready application servers
  • Use more advanced logging tools such as the Ruby port of structured logging libraries


Need help setting your project up? Join Zerops Discord community.

About

Bare-bone Ruby app on Zerops

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages