This repository demonstrates how to set up and deploy Filament applications using Zerops for both development and production environments.
Filament is a collection of beautiful full-stack components. This recipe showcases how to run a Filament application on Zerops, including all advanced functionalities, with sessions and cache stored in Redis and files stored in Object Storage, making it suitable for production of any size.
You can either click the deploy button to deploy development setup directly on Zerops or manually copy the import yaml to the import dialog in the Zerops app.
- Filament running on a load-balanced Zerops PHP + Nginx service
- Zerops PostgreSQL 16 service as database
- Zerops KeyDB (Redis) service for session and cache
- Zerops Object Storage (S3 compatible) service as file system
- Proper setup for Laravel cache, optimization, and database migrations
- Logs set up to use syslog and accessible through Zerops GUI
- Utilization of Zerops built-in environment variables system
- Utilization of Zerops readiness check for proper Zero downtime deployment
- Utilization of Zerops health check for advanced app monitoring
- Mailpit as SMTP mock server
- Adminer for quick database management tool
- S3browser for quick S3 storage browsing and testing
This setup includes tools and configurations for a rapid development cycle:
- Mailpit as the SMTP mock server
- Adminer for quick database management
- Fully commented-out configurations that you can easily switch to production settings
For a production-ready environment, consider the following modifications:
- Use a highly available version of the PostgreSQL database by changing
mode
fromNON_HA
toHA
in the recipe YAML. - Use at least two containers for the Filament service to achieve high reliability and resilience by adding
minContainers: 2
in the recipe YAML. - Use a production-ready third-party SMTP server instead of Mailpit.
- Disable public access to Adminer or remove it altogether from the recipe YAML.
You can see a production example setup at zerops-project-import-production.yml
.
To modify your existing Filament app to run efficiently on Zerops, follow these steps:
- Add zerops.yml to your repository. The provided example includes idempotent migrations, caching, and an optimized build process.
- Add league/flysystem-aws-s3-v3 to your composer.json to support Object Storage file system.
- Setup health checks if needed. Health checks are enabled out of the box in Laravel 11.
- Utilize Zerops environment variables and secrets to setup S3 for file system, Redis for cache and sessions, and trusted proxies to work with reverse proxy load balancer.
Need help setting your project up? Join the Zerops Discord community.