docker-vps-deploylisted
Install: claude install-skill itsgitz/agent-skills
# Docker VPS Deploy
## Overview
Build Docker image in CI, compress with gzip, transfer to VPS via rsync over SSH, load and run with Docker Compose. No container registry required — the image travels as a `.tar.gz` file.
## When to Use
- VPS with SSH access, Docker, and Docker Compose installed
- No container registry in the workflow (no Docker Hub, ECR, GHCR, etc.)
- Single-server or small-fleet deployment
- User asks to generate a GitHub Actions workflow for VPS deployment via rsync/SSH
## When NOT to Use
- Container registry already available → push/pull is simpler and faster
- Cloud-managed deployments (ECS, Cloud Run, Fly.io, Railway, Render)
- Multi-node orchestration (Kubernetes, Docker Swarm across nodes)
- Non-Docker deployments (bare-metal, systemd services)
## Prerequisites
On the VPS before first run:
- Docker and Docker Compose v2 (`docker compose`, not `docker-compose`) installed
- SSH key-based authentication configured for deploy user
- Deploy directory exists and is writable (e.g., `/opt/app`)
- `docker-compose.yml` present in the repository root
## Required Secrets
| Secret | Description | Example |
|--------|-------------|---------|
| `SSH_HOST` | VPS IP or hostname | `203.0.113.10` |
| `SSH_USER` | SSH login user | `deploy` |
| `SSH_KEY` | Private SSH key (Ed25519 PEM) | Contents of `~/.ssh/id_ed25519` |
| `SSH_PORT` | SSH port | `22` |
Add in: GitHub repo → Settings → Secrets and variables → Actions.
## Core Pipeline Pattern
```yaml
name: Depl