Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 1.15 KB

File metadata and controls

60 lines (39 loc) · 1.15 KB

Deployment

VM deployment

Run binaries directly:

  • cmd/api
  • cmd/smtp-inbound
  • cmd/smtp-submission
  • cmd/imap
  • cmd/autoconfig
  • cmd/orchestrator
  • cmd/mail-worker

Use process managers such as systemd, supervisor, or Nomad.

Docker deployment

All-in-one image:

docker build -t midemail:latest .

Select runtime service with MIDEMAIL_SERVICE.

Examples:

  • API: MIDEMAIL_SERVICE=api
  • Orchestrator: MIDEMAIL_SERVICE=orchestrator
  • Worker: MIDEMAIL_SERVICE=mail-worker
  • Migrations: MIDEMAIL_SERVICE=migrate, MIDEMAIL_MIGRATE_ARGS=up

Kubernetes deployment

Manifests live in deploy/k8s.

Apply order:

  1. namespace
  2. configmap
  3. secret
  4. migrate job
  5. deployments
  6. services

Terraform on Linode

Base IaC in deploy/terraform/linode:

  • VPC
  • LKE cluster
  • Redis VM

Use outputs to wire kubeconfig and Redis endpoint into K8s manifests/secrets.

Serverless patterns

  • Cloud Run: run MIDEMAIL_SERVICE=api and optionally autoconfig
  • Lambda (container): run API with an adapter layer (API Gateway/ALB integration)

Protocol services (SMTP/IMAP) typically remain on VM/K8s due to port and long-connection requirements.