Deployment
Dispatch runs on GKE with ArgoCD for GitOps deployment.
Infrastructure
| Component | Description |
|---|---|
| API Server | Gin HTTP server (port 8080) |
| Worker | Asynq background processor |
| SMTP Server | Email relay (ports 587, 465) |
| PostgreSQL | Primary database |
| Redis | Task queue (Asynq) |
| S3 | Image/attachment storage |
Docker Image
dockerfile
# Multi-stage build
FROM golang:1.25-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o server ./cmd/server
RUN go build -o worker ./cmd/worker
FROM alpine:latest
COPY --from=builder /app/server /app/worker /usr/local/bin/Kubernetes
Managed via the application repo:
application/
base/sending-saas-backend/
deploy.yaml # API deployment
service.yaml
api-ing.yaml # API ingress
smtp-health-check.yaml
swagger-ing.yaml
migration-hook.yaml # Pre-sync migration job
dev/sending-saas-backend/
patches/ # Dev overrides
prod/sending-saas-backend/
patches/ # Prod overridesCI/CD Pipeline
- Push to
main→ GitHub Actions - Run Go tests
- Build Docker image → push to GCP Artifact Registry
- ArgoCD detects new image digest → auto-deploy
Migrations
Database migrations run automatically via ArgoCD pre-sync hook:
bash
# Manual migration
go run cmd/migrate/main.go up
# Rollback
go run cmd/migrate/main.go down