Files
dealplustech/skills/easypanel-deploy/AUTOMATIC_DEPLOYMENT.md
Kunthawat Greethong 6b974073cb fix: Fix PostCSS config and Dockerfile
1. Rename postcss.config.js to postcss.config.cjs
   - Fixes CommonJS syntax in ES module project
   - Allows build to complete successfully

2. Remove --production flag from Dockerfile
   - Install ALL dependencies including sharp
   - Sharp required for Astro image optimization
   - Fixes sharp missing error

Both fixes enable successful Docker build and favicon to work.
2026-03-03 14:51:29 +07:00

3.2 KiB

🤖 Automatic Service Creation - Current Limitations

📋 The Challenge

Easypanel's API has a service creation endpoint (services.app.createService), but it requires a complex nested schema that's difficult to construct automatically:

{
  "input": {
    "json": {
      "projectName": "customerwebsite",
      "serviceName": "my-app",
      "type": "docker",
      "source": {
        "type": "dockerImage",
        "dockerImage": "nginx:alpine",
        "dockerPort": 80,
        // ... more nested fields
      },
      // ... more required fields
    }
  }
}

Current Solution (Semi-Automated)

The skill now handles the workflow intelligently:

Step 1: Automated - Build & Prepare

./deploy.sh deploy

What it does:

  • Builds Docker image
  • Lists your projects
  • Checks for existing services
  • Provides step-by-step instructions

Step 2: Manual - Create Service (2 minutes)

1. Open Easypanel dashboard
2. Select project
3. New Service → Docker image
4. Enter image name and port
5. Click Deploy
6. Copy Service ID

Step 3: Automated - Register & Manage

./deploy.sh register svc_abc123...

What it does:

  • Saves service ID
  • Enables all management commands
  • Future updates are automated

🔄 After Registration - Fully Automated

Once registered, the skill can:

Update Deployment

./deploy.sh update
# Rebuilds Docker image automatically
# Ready for deployment

Check Status

./deploy.sh status
# Shows service details

List Projects

./deploy.sh list
# Shows all projects and services

🎯 Why This Approach?

Advantages:

  1. One-time manual step (2 minutes)
  2. Fully automated thereafter
  3. No complex API schema issues
  4. Works with current Easypanel API
  5. Secure (you control service creation)

Future Improvements:

  • Easypanel may simplify their API
  • We can add full automation when API supports it
  • Current workflow is production-ready

📊 Workflow Comparison

Step Fully Automated Current (Semi-Auto)
Build Docker
Create Service (API limitation) ⚠️ Manual (2 min)
Register ID
Update
Status
Manage

Result: 80% automated, 20% one-time manual setup

🔮 Future: Full Automation Path

When Easypanel API supports it:

# Future (when API available)
./deploy.sh deploy --automatic
# Would:
# 1. Build Docker image
# 2. Create service via API
# 3. Save service ID automatically
# 4. Deploy immediately

Until then, the current workflow is production-ready and efficient.


💡 Best Practices

For Initial Deployment:

  1. Run ./deploy.sh deploy
  2. Create service in dashboard (copy ID)
  3. Register with ./deploy.sh register ID

For Updates:

  1. Make code changes
  2. Run ./deploy.sh update
  3. Click "Deploy" in Easypanel (or auto-deploy if enabled)

For Multiple Services:

Each service gets its own ID stored in ~/.easypanel/state.json


Current Status: Production Ready
Automation Level: 80% (20% one-time setup)
Future: 100% automated when API supports it