nginx-mailer

nginx-mailer

Docker app from geiserx's Repository

Overview

Lightweight nginx-based container (~35MB) for serving static websites with an integrated contact form that sends emails via SMTP. Single container runs both nginx and a Go API backend via supervisord. Includes optional Cloudflare Turnstile CAPTCHA integration.

Multi-arch (amd64/arm64). Perfect for personal or portfolio sites that need a simple contact form without a full backend.

More info: https://github.com/GeiserX/nginx-mailer

nginx-mailer banner

nginx-mailer

License Docker Pulls Docker Image Size

Lightweight Docker image based on nginx:alpine that serves static websites and handles contact form submissions via SMTP.


Features

  • 🚀 Based on nginx:1.29-alpine (~35MB total)
  • 📧 Built-in contact form API with SMTP support
  • 🔒 Cloudflare Turnstile CAPTCHA integration
  • 🐳 Single container (nginx + Go API)
  • 🏗️ Multi-arch: linux/amd64 and linux/arm64

Quick Start

docker run -d \
  -p 80:80 \
  -v /path/to/site:/usr/share/nginx/html:ro \
  -e SMTP_HOST=smtp.example.com \
  -e SMTP_PORT=465 \
  -e SMTP_USER=noreply@example.com \
  -e SMTP_PASSWORD=your-password \
  -e SMTP_FROM=noreply@example.com \
  -e CONTACT_EMAIL=you@example.com \
  drumsergio/nginx-mailer:latest

Docker Compose

services:
  website:
    image: drumsergio/nginx-mailer:latest
    ports:
      - "80:80"
    volumes:
      - ./website:/usr/share/nginx/html:ro
    environment:
      - SMTP_HOST=smtp.example.com
      - SMTP_PORT=465
      - SMTP_USER=noreply@example.com
      - SMTP_PASSWORD=your-password
      - SMTP_FROM=noreply@example.com
      - SMTP_FROM_NAME=My Website
      - CONTACT_EMAIL=you@example.com
      - CLOUDFLARE_TURNSTILE_SECRET_KEY=  # Optional
    restart: unless-stopped

Environment Variables

Variable Required Description
SMTP_HOST Yes SMTP server hostname
SMTP_PORT Yes SMTP port (465 for SSL, 587 for STARTTLS)
SMTP_USER Yes SMTP username
SMTP_PASSWORD Yes SMTP password
SMTP_FROM Yes From email address
SMTP_FROM_NAME No From display name
CONTACT_EMAIL Yes Recipient email for contact forms
CLOUDFLARE_TURNSTILE_SECRET_KEY No Turnstile secret key

API

POST /api/contact

{
  "nombre": "John Doe",
  "email": "john@example.com",
  "telefono": "+1234567890",
  "ubicacion": "City",
  "mensaje": "Hello...",
  "cf-turnstile-response": "token"
}

GET /health

Returns 200 OK for health checks.

HTML Form Example

<form action="/api/contact" method="POST">
  <input type="text" name="nombre" placeholder="Name" required>
  <input type="email" name="email" placeholder="Email" required>
  <input type="tel" name="telefono" placeholder="Phone">
  <textarea name="mensaje" placeholder="Message" required></textarea>
  
  <!-- Optional: Cloudflare Turnstile -->
  <div class="cf-turnstile" data-sitekey="your-site-key"></div>
  <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
  
  <button type="submit">Send</button>
</form>

License

MIT

Install nginx-mailer on Unraid in a few clicks.

Find nginx-mailer in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for nginx-mailer Review the template variables and paths Click Install

Download Statistics

1,628
Total Downloads

Related apps

Explore more like this

Explore all

Details

Repository
drumsergio/nginx-mailer:latest
Last Updated2026-06-23
First Seen2026-04-06

Runtime arguments

Web UI
http://[IP]:[PORT:80]/
Network
bridge
Privileged
false

Template configuration

HTTP PortPorttcp

HTTP port for the website

Target
80
Default
8080
Website FilesPathro

Static website files (read-only)

Target
/usr/share/nginx/html
Default
/mnt/user/appdata/nginx-mailer/html
SMTP HostVariable

SMTP server hostname

Target
SMTP_HOST
SMTP PortVariable

SMTP port (465 for SSL, 587 for STARTTLS)

Target
SMTP_PORT
Default
465
SMTP UserVariable

SMTP username

Target
SMTP_USER
SMTP PasswordVariable

SMTP password

Target
SMTP_PASSWORD
From EmailVariable

Sender email address

Target
SMTP_FROM
Contact EmailVariable

Recipient email for contact form submissions

Target
CONTACT_EMAIL
Turnstile SecretVariable

Cloudflare Turnstile CAPTCHA secret key (optional)

Target
CLOUDFLARE_TURNSTILE_SECRET_KEY