Skip to content

armgit / posta

Public Imported from GitHub
0

Self-hosted email delivery platform that enables applications to send emails via HTTP APIs while handling SMTP delivery, templates, storage, security, and analytics. Fully self-hostable alternative to services like SendGrid or Mailgun.

1.9 KB
Raw Blame
services:
  posta:
    build:
      context: .
      dockerfile: docker/Dockerfile
    ports:
      - "9000:9000"
    environment:
      POSTA_DB_URL: "host=posta-db user=posta password=posta dbname=posta port=5432 sslmode=disable"
      POSTA_REDIS_ADDR: "posta-redis:6379"
      # Local quick start only. Production rejects the placeholder credentials
      # below, so this file declares itself dev; see deploy/ for a deployable
      # template that requires real secrets.
      POSTA_ENV: "dev"
      POSTA_JWT_SECRET: "change-me-in-production"
      POSTA_ADMIN_EMAIL: "[email protected]"
      POSTA_ADMIN_PASSWORD: "admin1234"
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:9000/healthz"]
      interval: 30s
      timeout: 5s
      start_period: 10s
      retries: 3
    depends_on:
      posta-db:
        condition: service_healthy
      posta-redis:
        condition: service_healthy
    restart: unless-stopped

  worker:
    build:
      context: .
      dockerfile: docker/Dockerfile
    command: ["worker"]
    environment:
      POSTA_DB_URL: "host=posta-db user=posta password=posta dbname=posta port=5432 sslmode=disable"
      POSTA_REDIS_ADDR: "posta-redis:6379"
      POSTA_WORKER_CONCURRENCY: "10"
      POSTA_WORKER_MAX_RETRIES: "5"
    depends_on:
      posta-db:
        condition: service_healthy
      posta-redis:
        condition: service_healthy
    restart: unless-stopped

  posta-db:
    image: postgres:17-alpine
    environment:
      POSTGRES_USER: posta
      POSTGRES_PASSWORD: posta
      POSTGRES_DB: posta
    volumes:
      - db_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U posta"]
      interval: 5s
      timeout: 5s
      retries: 5

  posta-redis:
    image: redis:7-alpine
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  db_data:
  redis_data: