- Removed Next.js, moved Astro to root - PDPA compliance: cookie consent, admin dashboard, privacy policy - Updated Dockerfile for Astro - Ready for Easypanel deployment with Nixpacks or Docker
5.0 KiB
🚀 Easypanel Deployment Guide (Nixpacks)
Overview
This Astro website is configured for automatic deployment on Easypanel using Nixpacks.
✅ Auto-Detection
Easypanel will automatically detect this as a Node.js project and use Nixpacks to build it.
No Dockerfile required!
📋 Configuration
Easypanel Settings:
- Project Name:
dealplustech-astro - Service Name:
dealplustech-website - Build Type:
Nixpacks(auto-detected) - Source: Git repository
- Branch:
main - Port:
4321(or use$PORTenv variable) - Auto-Deploy: ✅ Enabled
🔐 Environment Variables
Set these in Easypanel → Settings → Environment:
# Database (SQLite file - Nixpacks will persist this)
ASTRO_DB_REMOTE_URL=file:/data/consent.db
# Admin Dashboard
ADMIN_PASSWORD=your-secure-password-here
# Umami Analytics (optional)
PUBLIC_UMAMI_WEBSITE_ID=your-website-id
PUBLIC_UMAMI_DOMAIN=https://analytics.moreminimore.com
# Site URL
PUBLIC_SITE_URL=https://your-domain.com
⚠️ IMPORTANT: Change ADMIN_PASSWORD from the default!
🗄️ Database Persistence
The consent logging database needs persistent storage.
Option A: Volume Mount (Recommended)
- In Easypanel, go to Service → Volumes
- Add a new volume:
- Path:
/data - Size:
1 GB(minimum)
- Path:
- Set environment variable:
ASTRO_DB_REMOTE_URL=file:/data/consent.db
Option B: Turso (Production)
For managed database:
- Create account at https://turso.tech
- Create database
- Get connection URL
- Set environment:
ASTRO_DB_REMOTE_URL=libsql://your-db.turso.io ASTRO_DB_APP_TOKEN=your-token
🔄 Deployment Workflow
Automatic (Git Push):
-
Make changes locally
# Edit files npm run build # Test locally git add . git commit -m "Update content" git push origin main -
Easypanel auto-deploys:
- Detects push to
main - Runs Nixpacks build
- Deploys new version
- Health checks pass
- Traffic switches
- Detects push to
-
Verify:
- Check Easypanel dashboard
- Visit website URL
- Test cookie consent
Manual (Force Deploy):
- Go to Service in Easypanel
- Click "Deploy"
- Select latest commit
- Deploy
📊 Monitoring
Health Check
Nixpacks will automatically health check the service.
Endpoint: http://localhost:4321/
Expected: Status 200 OK
Logs
View in Easypanel:
- Service → Logs
- Real-time deployment logs
- Runtime logs
Metrics
Easypanel provides:
- CPU usage
- Memory usage
- Network traffic
- Request count
🔐 Security Checklist
- Change
ADMIN_PASSWORDfrom default - Enable HTTPS (Easypanel provides SSL automatically)
- Set up firewall rules (if needed)
- Configure database persistence
- Regular backups of consent logs
🐛 Troubleshooting
Build Fails
Check:
npm run buildworks locallypackage.jsonscripts are correct- All dependencies installed
- Node version is 20.x
Fix:
npm install
npm run build
git push origin main
Database Errors
Check:
- Volume is mounted at
/data - Environment variable
ASTRO_DB_REMOTE_URLis set - Database file has write permissions
Fix:
# In Easypanel:
# 1. Add volume at /data
# 2. Set ASTRO_DB_REMOTE_URL=file:/data/consent.db
# 3. Redeploy
Cookie Consent Not Working
Check:
- CookieConsentBanner component is imported
- BASE_LAYOUT includes the component
- No console errors
Fix:
# Verify component is included in layout
# Check browser console for errors
# Clear cache and reload
Admin Dashboard 404
Check:
- Route is
/admin/consent-logs - Service is running
- No build errors
Fix:
# Access: https://your-domain.com/admin/consent-logs
# Login with ADMIN_PASSWORD
# Check server logs for errors
📈 Performance Optimization
Recommended Resources:
- CPU:
0.5core (minimum) - Memory:
512 MB(minimum) - Disk:
1 GBfor database
Caching:
Nixpacks automatically caches:
node_modules/- Build output
CDN (Optional):
For better performance, add Cloudflare:
- Point DNS to Easypanel
- Enable Cloudflare proxy
- Configure caching rules
📞 Support
Documentation:
- Astro: https://docs.astro.build
- Nixpacks: https://nixpacks.com
- Easypanel: https://easypanel.io/docs
Admin Dashboard:
- URL:
/admin/consent-logs - Password: Set via
ADMIN_PASSWORDenv
Contact:
- Email: info@dealplustech.co.th
- LINE: @dealplustech
✅ Post-Deployment Checklist
- Website loads correctly
- Cookie consent appears on first visit
- Consent is logged to database
- Admin dashboard accessible
- Umami Analytics loading (if configured)
- All pages working
- Mobile responsive
- HTTPS enabled (automatic with Easypanel)
- Database backed up regularly
Last Updated: 2026-03-10
Version: 1.0.0
Deployment: Nixpacks on Easypanel