
test-server-deploy
by koedame
SKILL.md
name: test-server-deploy description: Deploy services to test server via SSH. Builds Docker images locally, transfers them, and cleans up old images on both host and remote. allowed-tools: Bash(docker *), Bash(ansible-playbook *), Bash(gzip *), Bash(cargo run *), Bash(ssh *), Bash(rm *), Bash(ls *), Bash(sleep *), Read
Test Server Deploy
Deploy jamjam services (signaling-server, echo-server, cloudflared) to the test server.
Includes automatic cleanup of unused Docker images on both the local machine and remote server to prevent disk bloat.
Instructions
1. Build Docker Images
Build both images locally for AMD64 platform (test server is x86_64):
docker build --platform linux/amd64 -f Dockerfile.signaling -t jamjam-signaling:latest .
docker build --platform linux/amd64 -f Dockerfile.echo -t jamjam-echo:latest .
Note: The --platform linux/amd64 flag is required when building on Apple Silicon (ARM64) Mac for deployment to x86_64 servers. If you encounter platform mismatch errors on the server, rebuild with --no-cache:
docker build --platform linux/amd64 --no-cache -f Dockerfile.signaling -t jamjam-signaling:latest .
docker build --platform linux/amd64 --no-cache -f Dockerfile.echo -t jamjam-echo:latest .
2. Cleanup Old Images (Host)
After building, remove dangling images on the local machine to prevent disk bloat:
docker image prune -f
This removes:
- Intermediate build layers no longer used
- Untagged images left behind by previous builds
Report how much space was reclaimed.
3. Export Images
Save and compress the images for transfer:
rm -f /tmp/jamjam-images.tar.gz
docker save jamjam-signaling:latest jamjam-echo:latest | gzip > /tmp/jamjam-images.tar.gz
ls -lh /tmp/jamjam-images.tar.gz
Report the file size to the user (typically ~35MB).
4. Deploy via Ansible
Run the Ansible playbook to deploy:
cd ansible && ansible-playbook -i inventory/test.yml playbooks/site.yml
This will:
- Transfer the Docker images to the server
- Load the images into Docker
- Create/update
.envfile with environment variables - Create/update
docker-compose.yml - Start or restart services
- Wait for services to become healthy
5. Cleanup Old Images (Remote)
After deployment, remove unused images on the remote server:
ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "docker image prune -f"
This removes old versions of images that are no longer tagged (replaced by the new deployment).
Report how much space was reclaimed on the server.
6. Cleanup (Local Temp Files)
Remove the temporary image archive:
rm -f /tmp/jamjam-images.tar.gz
7. Verify Server Status
Check service status on the server:
ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "cd /opt/jamjam && docker compose ps"
All three services should be running:
jamjam-signaling- healthyjamjam-echo- healthyjamjam-cloudflared- running (no healthcheck)
8. Test CLI Connection
Test the signaling server connection using the CLI:
cargo run --release --bin jamjam -- rooms --server wss://test-signaling-jamjam.koeda.me
Expected output:
INFO Connecting to signaling server: wss://test-signaling-jamjam.koeda.me
INFO Connected, listing rooms...
Available rooms:
xxxxxxxx - [BOT] Echo Server (1000ms delay) (1/10 peers)
If the Echo Server room appears, the deployment is successful.
Server Information
| Item | Value |
|---|---|
| Host | 160.16.61.28 |
| User | ubuntu |
| SSH Key | PrivateDocs/jamjam_vps |
| App Directory | /opt/jamjam |
Services Deployed
- signaling-server - WebSocket signaling server (port 8080, localhost only)
- echo-server - Audio echo test server (port 5000/UDP)
- cloudflared - Cloudflare Tunnel for TLS termination
Troubleshooting
If deployment fails:
-
Platform mismatch error ("The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64)"):
- This occurs when building on Apple Silicon without specifying the target platform
- Solution: Rebuild images with
--platform linux/amd64 --no-cacheflags - See Step 1 for the correct build commands
-
Check SSH connectivity:
ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "echo OK" -
Check Docker images on server:
ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "docker images | grep jamjam" -
Check container logs:
ssh -i PrivateDocs/jamjam_vps ubuntu@160.16.61.28 "cd /opt/jamjam && docker compose logs --tail=50"
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon