Skip to content

zeropsio/recipe-phoenix

Repository files navigation

Zerops x Phoenix

Phoenix is a web framework for building building fast, reliable web applications in Elixir. This recipe helps you to get started with a Phoenix app on the Zerops platform.

phoenix


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

  • Phoenix 1.7 with LiveView for real-time features
  • PostgreSQL database integration with Ecto
  • Built with Bandit HTTP server (referenced in config/config.exs)
  • Asset bundling with esbuild and Tailwind
  • Email support via Swoosh
  • Health check endpoint at /status
  • JSON handling with Jason

Project Structure

The application consists of:

  • Phoenix Router handling incoming requests
  • Database integration using Ecto
  • LiveView for real-time features
  • Asset pipeline with esbuild and Tailwind
  • Email handling with Swoosh

Key endpoints:

  • GET / - Main application entry
  • GET /status - Health check endpoint
  • /live - LiveView routes

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 Phoenix service (add minContainers: 2 in recipe YAML)

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

  • containers are volatile - use Zerops object storage to store your files
  • Implement Redis (Valkey) for caching and session management


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