Prerequisites
1. Initialize Docker Swarm
On the manager node:
2. Join Worker Nodes (Optional)
On each worker node, run the join command provided by docker swarm init:
docker swarm join --token <token> <manager-ip>:2377
On ALL nodes (manager + workers):
-
Configure AWS credentials (see Prerequisites)
-
Install ECR credential helper:
sudo apt install -y amazon-ecr-credential-helper
- Configure
~/.docker/config.json:
{
"credHelpers": {
"605134458542.dkr.ecr.eu-west-3.amazonaws.com": "ecr-login"
}
}
Deployment
Deploy Commands
# Deploy
2501-infra deploy
# Stop services (scale to 0)
2501-infra deploy --stop
# Rolling restart
2501-infra deploy --restart
# Remove stack
2501-infra deploy --remove
For all deployment options:
Non-Interactive Mode
For CI/CD pipelines, use the --yes flag:
With --yes, the command fails immediately on any error. Ensure all configuration is valid before using in automation.
Post-Deployment
Verify Services
# Health checks
curl http://localhost:1337/health # Engine
curl http://localhost:3000/health # Command Center
# Check Swarm status
docker stack services 2501
Create Initial Entities
If you run 2501-infra deploy without --yes, the CLI will interactively prompt you to create your first tenant, organization, and admin user.
If you used --yes mode, create entities manually:
2501-infra tenant create --name "My Company"
2501-infra org create --name "Engineering" --tenant-id ten_xxx
2501-infra user create --email [email protected] --role ADMIN --tenant-id ten_xxx --org-id org_xxx
For all entity management commands:
2501-infra tenant -h
2501-infra org -h
2501-infra user -h
Useful Docker Commands
# Check service status
docker stack services 2501
# View logs
docker service logs -f 2501_engine
docker service logs -f 2501_command-center
# Scale services
docker service scale 2501_engine=4
# Rolling restart
docker service update --force 2501_engine