4.4 KiB
Deploying Frappe/ERPNext on Zerops
This repository contains the Zerops configuration file (zerops.yml) to deploy Frappe/ERPNext on the Zerops platform.
Architecture Overview
The deployment consists of the following services:
- MariaDB (
db) - Database service (HA mode) - Redis Cache (
redis-cache) - Caching layer - Redis Queue (
redis-queue) - Background job queue - Backend (
backend) - Main Frappe application server - Frontend (
frontend) - Nginx reverse proxy - WebSocket (
websocket) - Real-time communication server - Queue Workers (
queue-short,queue-long) - Background job processors - Scheduler (
scheduler) - Cron job scheduler
Prerequisites
- A Zerops account - Sign up here
- Access to this GitHub repository
- Basic knowledge of Frappe/ERPNext
Deployment Steps
1. Import Project to Zerops
- Log into your Zerops dashboard
- Click "Import project"
- Select "Import from Git repository"
- Enter the repository URL:
https://github.com/UhrinDavid/frappe_docker - Select the
zerops.ymlfile - Click "Import project"
2. Configure Environment Secrets
Before deployment, you need to set the following environment secrets in Zerops:
Required Secrets:
db_password- Password for MariaDB database (choose a strong password)site_name- Your site domain name (e.g.,mycompany.example.com)
Optional Secrets:
ERPNEXT_VERSION- ERPNext version (default: v15.84.0)
To set secrets:
- Go to your project in Zerops dashboard
- Navigate to each service
- Go to "Environment variables" section
- Add the required secrets
3. Deploy the Services
- Zerops will automatically start building and deploying all services
- Monitor the build progress in the Zerops dashboard
- Wait for all services to reach "Running" status
4. Post-Deployment Setup
Once all services are running, you need to initialize your Frappe site:
-
Access the backend service terminal in Zerops dashboard
-
Create your first site:
bench new-site your-site-name --db-root-password <db_password> -
Install ERPNext:
bench --site your-site-name install-app erpnext -
Set the site as default:
bench use your-site-name -
Create an admin user:
bench --site your-site-name add-user admin administrator --password <admin-password>
5. Access Your Application
Your Frappe/ERPNext instance will be available at the domain provided by Zerops for the frontend service.
Configuration Details
Resource Allocation
- Backend: 1-3 containers, autoscaling enabled
- Frontend: 1-2 containers
- WebSocket: 1-2 containers
- Queue Workers: 1-3 containers (short), 1-2 containers (long)
- Scheduler: 1 container (fixed)
- Databases: HA mode for production reliability
Health Checks
All services include health checks to ensure proper operation:
- Backend:
/api/method/ping - Frontend:
/api/method/ping - WebSocket:
/socket.io/
Autoscaling
Backend and queue workers have autoscaling configured based on:
- CPU usage threshold: 70%
- Memory usage threshold: 80%
Troubleshooting
Common Issues
- Services not starting: Check environment variables are set correctly
- Database connection errors: Verify
db_passwordsecret is set - Site access issues: Ensure
site_namematches your domain
Logs
Access service logs through the Zerops dashboard:
- Go to your project
- Select the service
- Navigate to "Runtime logs"
Manual Commands
To run manual bench commands:
- Access the backend service terminal
- Navigate to
/home/frappe/frappe-bench - Run your bench commands
Customization
Custom Apps
To add custom Frappe apps:
- Modify the Dockerfile to include your apps
- Update the
zerops.ymlbuild configuration - Redeploy the services
Environment Variables
Additional environment variables can be added in the zerops.yml file under the envSecrets section for each service.
Scaling
Adjust the minContainers and maxContainers values in zerops.yml based on your traffic requirements.
Support
For issues specific to:
- Zerops platform: Zerops Documentation
- Frappe/ERPNext: Frappe Documentation
- This deployment setup: Create an issue in this repository
License
This configuration is provided under the same license as the original frappe_docker repository.