Deploying to a Cluster
Deploying to a Docker Swarm cluster follows the same general workflow as standalone deployments, with additional steps for pushing and pulling images through a container registry.
Prerequisites
Before deploying to a cluster, ensure you have:
- A cluster set up with at least a leader node and one worker node
- A container registry configured with valid credentials
- At least one build server assigned to the cluster (recommended: a standalone server, not a cluster node)
Step-by-Step Deployment
1. Create an Application
- Go to the Appliku dashboard and click Create Application
- Connect your Git repository (GitHub, GitLab, or custom Git URL)
- Select the branch to deploy from
- For deployment target, select your cluster (instead of a standalone server)
2. Configure the Application
Set up your application as you would for a standalone deployment:
- Build settings -- Choose a build image or use a Dockerfile
- Environment variables -- Add any required configuration
- Processes -- Define your
web,release,worker, and other process types
3. Add a Database (If Needed)
Databases can only be deployed on standalone servers, not inside a cluster. Select a standalone server when adding a database. The database connection URL is still injected into your cluster application as an environment variable.
4. Deploy
Trigger a deployment by pushing to your branch or clicking Deploy in the dashboard. The build process works as follows:
- Code pull -- The build server clones your repository
- Image build -- Docker image is built using your configured build image or Dockerfile
- Image push -- The built image is pushed to your configured container registry
- Release phase -- If a
releaseprocess is defined, it runs on the leader node (e.g., database migrations) - Service update -- Docker Swarm pulls the new image on cluster nodes and updates running services
- Health check -- Swarm verifies containers are healthy before routing traffic
5. Set Process Scale
After deploying, configure the number of replicas for each process:
- Go to the Processes tab of your application
- For each process, click Change Scale
- Set the desired number of replicas
Docker Swarm distributes replicas across available worker nodes automatically.
Build Flow Comparison
| Step | Standalone | Cluster |
|---|---|---|
| Build | On the same server | On a dedicated build server |
| Image storage | Local on server | Pushed to container registry |
| Deployment | Docker Compose restart | Docker Swarm service update across nodes |
| Scaling | On/Off per process | N replicas per process |
Monitoring Deployments
- Build logs -- Available in the Deployments tab, showing each build step
- Application logs -- Available from Application Overview > App Logs, select the process/service to view
- Deployment status -- Tracked as: new, deploying, deployed, failed, timeout, or aborted
Next Steps
- Scaling in Clusters -- Scale processes across worker nodes
- Cluster Limitations -- Important constraints to be aware of
- Container Registry Setup -- Configure registry credentials