skills/deployment/SKILL.md
Deploy, debug, and maintain services on Render and containerized platforms
npx skillsauth add alexwelcing/copy deploymentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert deployment engineer specializing in containerized web services on Render and similar PaaS platforms. Your goal is to ensure reliable builds, correct service configuration, and zero-downtime deploys.
docker build catches 90% of deploy failureshttps://<service-name>.onrender.comhttp://service:port)render.yaml defines infrastructure-as-code for initial setupdockerContext, dockerfilePath, envVars, buildCommand# If your service root is a subdirectory:
dockerContext: frontend # Build context = ./frontend/
dockerfilePath: frontend/Dockerfile # Dockerfile location from repo root
# Inside the Dockerfile, paths are relative to dockerContext:
COPY go.mod go.sum ./ # Copies frontend/go.mod, frontend/go.sum
COPY . . # Copies everything in frontend/
Common trap: Changing dockerContext in render.yaml after initial deploy may not take effect if the dashboard has its own setting locked in. Verify in the Render dashboard under Service > Settings > Build & Deploy.
envVarKey references for shared secrets between services:- key: API_SECRET
fromService:
type: web
name: other-service
property: envVar
envVarKey: API_SECRET
# Build stage — large image with build tools
FROM golang:1.24-bookworm AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o server main.go
# Run stage — minimal image
FROM debian:bookworm-slim
WORKDIR /app
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/server .
COPY --from=builder /app/templates ./templates
COPY --from=builder /app/data ./data
ENV PORT=8080
EXPOSE 8080
CMD ["./server"]
Before writing any COPY instruction, verify:
| Symptom | Cause | Fix |
|---------|-------|-----|
| COPY failed: file not found | Path outside build context | Move files into context or change context |
| COPY failed: no such file | File in .gitignore/.dockerignore | Remove from ignore or use different path |
| App starts but serves empty data | Data files not copied to runtime stage | Add COPY --from=builder for data directory |
| connection refused between services | Using localhost or Docker hostname on PaaS | Use public service URL |
| Port mismatch in docker-compose | Host:container port mapping wrong | Match container port to what app listens on |
The CI pipeline must use the same toolchain as the app:
Go frontend (not Node.js):
- uses: actions/setup-go@v5
with:
go-version: '1.24'
- run: go vet ./...
- run: CGO_ENABLED=0 go build -o server main.go
Python backend:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install -r requirements.txt
- run: pytest
Match CodeQL languages to actual codebase:
languages: python, go # NOT python, javascript (if frontend is Go)
When a frontend proxies requests to a backend API:
// 1. Always set a timeout
client := &http.Client{Timeout: 30 * time.Second}
// 2. Handle request creation errors
req, err := http.NewRequest(method, target, body)
if err != nil {
log.Printf("ERROR: proxy request failed: %v", err)
c.JSON(500, gin.H{"error": "Internal server error"})
return
}
// 3. Only forward safe headers
safeHeaders := map[string]bool{
"Content-Type": true, "Accept": true,
"Authorization": true, "Accept-Language": true,
}
for k, v := range incomingHeaders {
if safeHeaders[http.CanonicalHeaderKey(k)] {
req.Header[k] = v
}
}
req.Header.Set("X-Forwarded-For", clientIP)
Never forward: Host, Cookie, Connection, Transfer-Encoding, or other hop-by-hop headers.
docker build -t test . succeeds locally from the correct context directorygit ls-files <path> (untracked files won't be in the deploy)docker build with the same context directorycurl https://<service>.onrender.com/healthWhen auditing or planning a deployment, deliver:
launch-strategy — coordinating deploy timing with marketing launchesanalytics-tracking — ensuring tracking survives deployment changesab-test-setup — deploying experiment variantstesting
Create engaging social media content strategies and posts
tools
Optimize signup and registration flows for higher conversion
testing
Conduct comprehensive SEO audits and provide actionable recommendations
data-ai
Implement structured data for enhanced search visibility