|
| 1 | +# documentation: https://docs.unsend.dev/get-started/self-hosting |
| 2 | +# slogan: Unsend is an open-source alternative to Resend, Sendgrid, Mailgun and Postmark etc. |
| 3 | +# tags: resend, mailer, marketing emails, transaction emails, self-hosting, postmark |
| 4 | +# logo: svgs/unsend.svg |
| 5 | +# port: 3000 |
| 6 | + |
| 7 | +services: |
| 8 | + postgres: |
| 9 | + image: postgres:16 |
| 10 | + container_name: unsend-db-prod |
| 11 | + restart: always |
| 12 | + environment: |
| 13 | + - POSTGRES_USER=${SERVICE_POSTGRES_USER:?err} |
| 14 | + - POSTGRES_PASSWORD=${SERVICE_POSTGRES_PASSWORD:?err} |
| 15 | + - POSTGRES_DB=${SERVICE_POSTGRES_DB:?err} |
| 16 | + healthcheck: |
| 17 | + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"] |
| 18 | + interval: 10s |
| 19 | + timeout: 5s |
| 20 | + retries: 5 |
| 21 | + volumes: |
| 22 | + - unsend-db:/var/lib/postgresql/data |
| 23 | + |
| 24 | + redis: |
| 25 | + image: redis:7 |
| 26 | + container_name: unsend-redis-prod |
| 27 | + restart: always |
| 28 | + volumes: |
| 29 | + - unsend-cache:/data |
| 30 | + command: ["redis-server", "--maxmemory-policy", "noeviction"] |
| 31 | + |
| 32 | + unsend: |
| 33 | + image: unsend/unsend:latest |
| 34 | + container_name: unsend |
| 35 | + restart: always |
| 36 | + ports: |
| 37 | + - ${PORT:-3000}:${PORT:-3000} |
| 38 | + environment: |
| 39 | + - PORT=${PORT:-3000} |
| 40 | + - DATABASE_URL=postgresql://postgres:${SERVICE_POSTGRES_PASSWORD}@postgres:5432/resend |
| 41 | + - NEXTAUTH_URL=${SERVICE_NEXTAUTH_URL:?err} |
| 42 | + - NEXTAUTH_SECRET=${SERVICE_NEXTAUTH_SECRET:?err} |
| 43 | + - AWS_ACCESS_KEY=${SERVICE_AWS_ACCESS_KEY:?err} |
| 44 | + - AWS_SECRET_KEY=${SERVICE_AWS_SECRET_KEY:?err} |
| 45 | + - AWS_DEFAULT_REGION=${SERVICE_AWS_DEFAULT_REGION:?err} |
| 46 | + - GITHUB_ID=${SERVICE_GITHUB_ID:?err} |
| 47 | + - GITHUB_SECRET=${SERVICE_GITHUB_SECRET:?err} |
| 48 | + - REDIS_URL=redis://redis:6379 |
| 49 | + - NEXT_PUBLIC_IS_CLOUD=${NEXT_PUBLIC_IS_CLOUD:-false} |
| 50 | + - API_RATE_LIMIT=${SERVICE_API_RATE_LIMIT:-1} |
| 51 | + depends_on: |
| 52 | + postgres: |
| 53 | + condition: service_healthy |
| 54 | + redis: |
| 55 | + condition: service_started |
| 56 | + |
| 57 | +volumes: |
| 58 | + unsend-db: |
| 59 | + unsend-cache: |
0 commit comments