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.
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.
- Plug + Cowboy HTTP server running on a load balanced Zerops Elixir service
- Zerops PostgreSQL service as database
- Built with
plug_cowboyfor 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
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 countGET /status- Health check endpoint
Base of the recipe is ready for production. For production deployment, consider:
- Using highly available version of the PostgreSQL database (change
modefromNON_HAtoHAin recipe YAML) - Using at least two containers for the Elixir service (add
minContainers: 2in 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.