Remotely manage Docker Compose instances via SSH. Execute docker compose commands, view logs, update images, and exec into containers on remote servers. Use...
Remotely manage Docker Compose instances through SSH connections.
This skill provides a complete set of actions for Docker Compose lifecycle management on remote servers. All operations are performed via SSH, requiring only standard SSH and Docker tools on both client and server.
# Start services
docker_compose_up host=192.168.1.100 user=root path=/opt/myapp
# Check status
docker_compose_ps host=192.168.1.100 user=root path=/opt/myapp
# View logs
docker_compose_logs host=192.168.1.100 user=root path=/opt/myapp tail=50
# Update and restart
docker_compose_update host=192.168.1.100 user=root path=/opt/myapp pull=always
Start Docker Compose services in detached mode.
Parameters:
host (required): Remote SSH host (IP or hostname)user (required): SSH usernamepath (required): Directory containing docker-compose.ymlport (optional, default: 22): SSH portkey_path (optional): SSH private key pathtimeout (optional, default: 60): Operation timeout in secondsExample:
docker_compose_up host=192.168.1.100 user=admin path=/opt/app port=2222
Stop and remove containers, networks, and volumes defined in docker-compose.yml.
Parameters: Same as up
Example:
docker_compose_down host=192.168.1.100 user=admin path=/opt/app
Start specific stopped services.
Parameters:
up parametersservice (optional): Service name to start (starts all if not specified)Example:
docker_compose_start host=192.168.1.100 user=admin path=/opt/app service=web
Stop running services without removing them.
Parameters:
up parametersservice (optional): Service name to stop (stops all if not specified)Example:
docker_compose_stop host=192.168.1.100 user=admin path=/opt/app service=worker
Restart services.
Parameters:
up parametersservice (optional): Service name to restartExample:
docker_compose_restart host=192.168.1.100 user=admin path=/opt/app service=api
List all containers with their status.
Parameters: Same as up
Example:
docker_compose_ps host=192.168.1.100 user=admin path=/opt/app
Fetch and display logs from services.
Parameters:
up parametersservice (optional): Filter logs to specific servicetail (optional, default: 100): Number of lines to showfollow (optional, default: false): Stream logs continuouslyExample:
docker_compose_logs host=192.168.1.100 user=admin path=/opt/app tail=50 follow=true
Pull the latest images and restart services.
Parameters:
up parametersforce_recreate (optional, default: false): Force recreate containerspull (optional): Image pull policy (never, always, missing)command (optional): Custom command to execute instead of default "pull && up"Example:
# Default behavior
docker_compose_update host=192.168.1.100 user=admin path=/opt/app pull=always
# Custom command
docker_compose_update host=192.168.1.100 user=admin path=/opt/app command="sh ./upgrade.sh"
Execute a command in a running container.
Parameters:
up parametersservice (required): Container name to execute incommand (required): Command to executetimeout (optional, default: 60): Command execution timeoutExample:
docker_compose_exec host=192.168.1.100 user=admin path=/opt/app service=web command="ls -la /app"
-d flag for detached mode when starting servicesCommon errors and handling:
This skill supports a deploy-apps.json configuration file that maps your remote hosts and applications. The Agent automatically reads this configuration to resolve host aliases, app names, SSH credentials, and file paths.
The structure of the deploy-apps.json file should be as follows:
{
"hosts": {
"<host-alias>": {
"host": "remote.server.com",
"description": "Server description",
"base-dir": "/path/to/docker",
"user": "ssh-user",
"apps": {
"<app-name>": {
"description": "Application description",
"update-command": "Custom command to execute update"
}
}
}
}
}
When you reference a host alias or app name, the Agent:
deploy-apps.json to find the matching configurationhost to the actual SSH hostname/IPpath from <base-dir>/<app-name>user for SSH authentication| Parameter | Type | Required | Description |
|---|---|---|---|
hosts.<alias>.host | string | Yes | Remote SSH hostname or IP |
hosts.<alias>.base-dir | string | Yes | Base directory containing app folders |
hosts.<alias>.user | string | Yes | SSH username |
hosts.<alias>.description | string | No | Human-readable description |
hosts.<alias>.apps.<name>.description | string | Yes* | App description |
hosts.<alias>.apps.<name>.update-command | string | Yes* | Custom command to execute update |
With:
base-dir: /data/dockerapp-name: mysqlThe resolved path would be: /data/docker/mysql
ZIP package — ready to use