Skip to content

Deployment

Updated April 2026. Docker Swarm decommissioned — all deployments are now k3s.

Workflow

1. Edit source on apps-dev1 (/opt/development/recipicity/)
2. Build + push image from apps-dev1
3. Update manifest on dockerrr (/opt/docker/homelab/k3s-manifests/)
4. Apply manifest via kubectl on apps-app1
5. Monitor rollout

Build & Push (from apps-dev1)

cd /opt/development/recipicity

# Build and push (--deploy flag is Swarm-only legacy — do NOT use)
bash build.sh frontend --env production --push
bash build.sh api --env production --push
bash build.sh all --env staging --push

After push, the output shows the image digest (sha256:...). Use this in the manifest.

Apply Manifest (from dockerrr or apps-dev1)

# Edit manifest on dockerrr
vim /opt/docker/homelab/k3s-manifests/recipicity-production/frontend.yaml

# Apply (kubectl runs on apps-app1 — pipe via stdin)
cat /opt/docker/homelab/k3s-manifests/recipicity-production/frontend.yaml \
  | ssh john@192.168.51.10 "kubectl apply -f -"

Monitor Rollout

ssh john@192.168.51.10 "kubectl rollout status deployment/frontend -n recipicity-production"
ssh john@192.168.51.10 "kubectl get pods -n recipicity-production"
ssh john@192.168.51.10 "kubectl logs -n recipicity-production deployment/frontend --tail=50"

Common kubectl Commands

# All pods across cluster
kubectl get pods -A

# Restart a deployment (rolling)
kubectl rollout restart deployment/<name> -n <namespace>

# Check unhealthy pods
kubectl get pods -A | grep -v Running | grep -v Completed

# Describe a pod (scheduling issues, events)
kubectl describe pod <pod-name> -n <namespace>

# Execute command in running pod
kubectl exec -n <namespace> deployment/<name> -- <command>

Rollback

# Roll back to previous ReplicaSet
ssh john@192.168.51.10 "kubectl rollout undo deployment/<name> -n <namespace>"

# Check rollout history
ssh john@192.168.51.10 "kubectl rollout history deployment/<name> -n <namespace>"

Database Migrations (Recipicity)

Migrations MUST bypass PgBouncer (connect directly to postgres:5432):

# Run migration from inside an API pod
ssh john@192.168.51.10 "kubectl exec -n recipicity-production deployment/api \
  -- npx prisma migrate deploy"

Never run prisma migrate dev in production. Always test in staging first.

Docs Site

Source: /opt/docs/ on apps-edge (192.168.51.50)

ssh john@192.168.51.50 "cd /opt/docs && bash build-and-deploy.sh"

Image: registry.apps.jlwaller.com/platform-docs:latest Deployed as docs deployment in apps namespace.