Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 2.02 KB

README.md

File metadata and controls

55 lines (39 loc) · 2.02 KB

Zerops x Elixir

This is a bare-bones example of an Elixir application running on Zerops — as few libraries as possible, just a simple endpoint with connnect, read and write to a Zerops PostgreSQL database.

elixir


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

  • Plug + Cowboy HTTP server running on a load balanced Zerops Elixir service
  • Zerops PostgreSQL service as database
  • Built with plug_cowboy for HTTP server functionality
  • Ecto for database interactions
  • Health check endpoint at /status
  • Utilization of Zerops' built-in environment variables system
  • JSON response handling with Jason

Project Structure

The application consists of:

  • HTTP Router handling incoming requests
  • Database integration using Ecto
  • Simple entry creation and counting system
  • JSON response formatting

Key endpoints:

  • GET / - Creates a new entry and returns count
  • GET /status - Health check endpoint

Production vs. Development

Base of the recipe is ready for production. For production deployment, consider:

  • Using highly available version of the PostgreSQL database (change mode from NON_HA to HA in recipe YAML)
  • Using at least two containers for the Elixir service (add minContainers: 2 in recipe YAML)

Additional production considerations:

  • Use Zerops object storage for file storage
  • Implement Redis (Valkey) for caching and session management
  • Add comprehensive logging and monitoring
  • Implement proper error handling and reporting


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