When to use Rebuild & Deploy
- Dockerfile changes – When you’ve updated the
Dockerfileor build context. - Dependencies update – If you changed
package.json,requirements.txt, or other dependency files. - Build configuration changes – Updating
context,dockerfilePath, orautoBuildinDCDeploy.yml. - Corrupted image fixes – Forcing a clean rebuild ensures the latest state is deployed.
How Rebuild & Deploy Works
-
Fresh Build
- DCDeploy ignores cached layers.
- A new Docker image is built from your repository or build context.
-
Deploy Rollout
- The new image is deployed to your service.
- If zero downtime deployment is enabled, old containers are kept alive until the new ones pass health checks.
Rebuild & Deploy via Dashboard
- Open the DCDeploy dashboard.
- Navigate to your service.
- Click Rebuild & Deploy.
- Confirm the rebuild trigger.
- Watch build and deployment logs in real-time.
Auto Rebuild on Commit
If you setautoBuild: true in your DCDeploy.yml, DCDeploy automatically triggers a Rebuild & Deploy whenever you push new commits to the specified branch.
Example:
- Every commit to main will rebuild and deploy the service automatically.
- Ensures your production always runs the latest code.
- Works with both public and private repositories.
Key Difference: Redeploy vs Rebuild & Deploy
| Feature | Redeploy | Rebuild & Deploy |
|---|---|---|
| Uses cached image? | Yes | No (fresh build) |
| Speed | Faster | Slower (full build) |
| Use case | Code/config changes only | Dockerfile/dependencies/build changes |
Best Practices
- Use Redeploy for small code/config changes.
- Use Rebuild & Deploy when build environment changes are required.
- Test in staging before running on production.
- Enable zero downtime to avoid interruptions during rebuilds.
- Prefer autoBuild: true for continuous integration workflows.
