filiptrivan/spiderly/deployment
Claude Code and agent skill by filiptrivan/spiderly
- community
Checking that the SKILL.md file is still in the repository.
Deploy a Spiderly project to production and keep it running. Use when deploying, redeploying, shipping, releasing, or rolling out the .NET backend or Angular admin — first-time setup or an ongoing deploy — and when diagnosing a down or erroring production origin (502/521, container crash-loop, failed deploy workflow). Covers the recommended VPS + Docker Compose + Caddy + Cloudflare + Terraform stack, CI/CD pipelines, TLS with Cloudflare origin certificates, and infrastructure-as-code layout.
Install
npx vskill@latest install filiptrivan/spiderly/deploymentSKILL.md
Deployment
Spiderly runs anywhere a .NET app does — there is no required host, orchestrator, or reverse proxy. The stack below is the one we recommend and test end to end: a single VPS running Docker Compose, fronted by Caddy and Cloudflare, with all infrastructure declared in Terraform. Swap any tier for your own — the only genuinely Spiderly-specific deploy concerns are flagged inline (EF migrations before app start, forwarded-header/proxy trust, cookie domain across subdomains, the CORS frontend URL, and the api + admin subdomain split).
Recommended stack
| Tier | Choice | Why | |
|---|---|---|---|
| Compute | Hetzner Cloud (or any VPS) | Predictable monthly cost, full control, no PaaS lock-in | |
| Orchestration | Docker Compose | Single-host simplicity; reproducible, agent-friendly deploys | |
| Reverse proxy / TLS | Caddy v2 | Auto-config from Cloudflare origin certs, simple Caddyfile | |
| DNS / WAF / CDN | Cloudflare (orange-cloud) | DDoS protection, origin certs, Turnstile | |
| IaC | Terraform | Declarative; one source of truth for VPS + DNS + certs | |
| State backend | Cloudflare R2 | S3-compatible, free tier, encrypted at rest | |
| Container registry | GitHub Container Registry (GHCR) | Free for public/internal repos, native to GitHub Actions | |
| CI/CD | GitHub Actions | Build, push, SSH-deploy in one workflow file |
What to host where
- .NET Backend → Hetzner+Docker (recommended)
- Angular admin → Hetzner+Docker, same VPS as the backend, served by the same Caddy on a separate subdomain
- Next.js storefront (if applicable) → Vercel recommended. Next.js + Vercel gives you ISR, edge caching, image optimization, PPR, and instant preview URLs. Hetzner+Docker for SSR is viable but loses these features. Use Hetzner only if you need a single ops surface.
Compose stack shape
Backend/docker-compose.prod.yml (placed alongside the backend project):
Key points:
- Only
caddybinds host ports.backendandadminare reachable only on the internal Docker network — Caddy reverse-proxies to them by service name. caddy.depends_onusescondition: service_healthyfor the admin container (so Caddy doesn't 502 before the inner Caddy has bound port 80) butcondition: service_startedfor the backend — the backend's/healthendpoint only goes green after EF migrations and warmup, and gating Caddy on that would block all traffic for 20–30 s on every restart.- Image tags come from CI via envsubst (
${BACKEND_IMAGE},${ADMIN_IMAGE}). - postgres:18+ mounts at `/var/lib/postgresql`, not `/var/lib/postgresql/data`. The 18 image moved data into a major-version subdirectory (
PGDATA=/var/lib/postgresql/18/docker). With the pre-18 mount path the entrypoint hard-errors ("there appears to be PostgreSQL data in /var/lib/postgresql/data") and the container crash-loops — and even when it starts, data lands in an anonymous volume and does not survive container recreation.
Caddy site blocks
Backend/Caddyfile — extracts compression + security headers into a (common) snippet so both site blocks stay DRY. Cloudflare also sets some of these (HSTS, Brotli) at its edge, but defense-in-depth at the origin is cheap and keeps origin→Cloudflare bandwidth compressed:
Both subdomains share a single Cloudflare origin cert with both names as SANs (set up in Terraform — see below).
Backend Dockerfile
Backend/Dockerfile (multi-stage SDK build → aspnet runtime):
Pin patch versions (9.0.102 SDK, 9.0.1 runtime) — :9.0 floats and breaks reproducible builds.
Run as non-root. The aspnet image ships an app user (UID 1654). Add USER app after COPY for defense-in-depth — limits the blast radius of a container escape and matches the platform's sandbox model.
Log volumes: if you're using a Serilog File sink (not just Console) with a Hangfire log-archival job, see Log archival in the backups skill for the full bind-mount-vs-Console-only trade-off. Greenfield deploys can stick with Console sink + Docker's json-file rotation and skip the volume entirely.
Angular admin Dockerfile
Frontend/Dockerfile (multi-stage Node build → Caddy alpine runtime):
Frontend/Caddyfile (internal — runs inside the admin container):
The try_files {path} /index.html line is the SPA fallback that lets the Angular router handle deep links.
Two details in the cache rules matter. Angular's esbuild builder names hashed files name-HASH.js (eight uppercase letters and digits), so a \.[a-f0-9]{8,}\.js pattern written for the old webpack names matches nothing. And header runs before try_files, so a path /index.html matcher never sees a navigation to / or /orders: the ?Cache-Control default covers them. Without any Cache-Control a browser guesses a freshness lifetime (Chromium: a tenth of the time since Last-Modified) and can open the app from a pre-deploy index.html.
Lockfile gotcha: npm ci requires package.json and package-lock.json to be in sync. If a stale dev-dep pins an older Angular major as a peer (e.g. @jsverse/transloco-keys-manager 5.x pins Angular 17 while your project is on Angular 19), npm ci fails. Bump the dev-dep to the matching major (e.g. transloco-keys-manager 6.x for Angular 19) rather than reaching for --legacy-peer-deps.
Terraform layout
Split files by provider concern; one provider, one or two files:
main.tf providers:
Origin cert covering both api and admin subdomains (cloudflare-origin-cert.tf):
Sensitive outputs (outputs.tf) so the deploy workflow can pull cert + key into GitHub Secrets:
Retrieve with terraform output -raw origin_cert and paste into a GitHub Secret. Note: the API token must have Origin CA: Edit scope for cloudflare_origin_ca_certificate to work.
CI/CD
Two workflows — one per deploy unit. Both should share a concurrency group so they serialize on the same VPS:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclaude-plugins/skills/deployment/SKILL.md
Popularity
- Repository stars
- 60
- Repository forks
- 24
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/filiptrivan/spiderly/deployment)