---
description: Deploy ke VPS/cloud — Docker build, push, run di remote server
---

# Deploy

## Steps

1. **Verify Build**
   Make sure code compiles/runs locally first:
   - Python: `python -c "import main"`
   - Rust: `cargo build --release`
   - Go: `go build -o binary`
   - Docker: `docker build -t d1337/tool:latest .`

2. **Prepare Dockerfile** (if not exists)
   Create Dockerfile following D1337 standards:
   - Multi-stage build (build → runtime)
   - Minimal base image (alpine/distroless)
   - Non-root user
   - No secrets in image

3. **Build & Tag**
   ```
   docker build -t d1337/tool:latest .
   docker tag d1337/tool:latest registry/tool:latest
   ```

4. **Push to Registry**
   ```
   docker push registry/tool:latest
   ```

5. **Deploy to VPS**
   ```
   ssh user@vps "docker pull registry/tool:latest && docker run -d --restart=unless-stopped registry/tool:latest"
   ```

6. **Verify**
   Check deployment is running:
   ```
   ssh user@vps "docker ps | grep tool"
   ```

7. **Report to Ketua**
   Provide: deployment URL, container ID, logs snippet.
