hatch-surf/deploy.sh
Chris Anderson 475fd95a59
Some checks are pending
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Update deployment: Go API backend with Docker Compose
- Update Dockerfile to golang:1.26-alpine (matching go.mod)
- Update deploy.sh for Docker Compose workflow
- Rewrite DEPLOYMENT.md for new API architecture
- Add env vars for face service and Redis configuration
2026-06-26 05:55:56 +02:00

33 lines
782 B
Bash
Executable File

#!/bin/bash
# Deploy hatch.surf API — triggered by Gitea webhook or manually
set -e
echo "=== Deploying hatch API ==="
cd /home/nara/apps/web
# Pull latest changes from GitHub (primary source)
git pull github main
# Push to Gitea (push-mirror)
git push origin main
# Stop old containers
docker compose down 2>/dev/null || true
# Rebuild and start
docker compose build hatch
docker compose --profile with-caddy up -d
# Verify
sleep 3
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/healthz | grep -q "200"; then
echo "✅ hatch API deployed successfully!"
echo " Health: http://localhost:8080/healthz"
echo " Ready: http://localhost:8080/readyz"
else
echo "❌ Deployment failed!"
docker compose logs --tail=20 hatch
exit 1
fi