Docker image based on nginx:alpine that serves a static site and sends its contact form by SMTP, with optional Cloudflare Turnstile.
- Serves a static site from a mounted folder with nginx on port 80.
- Contact form endpoint
POST /api/contactthat emails each submission to one address. - SMTP over TLS (port 465) or STARTTLS (other ports).
- Optional Cloudflare Turnstile CAPTCHA check.
- One container: nginx and the Go mail service run under supervisord.
linux/amd64image on Docker Hub.
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:1.0.0The site is served on port 80, with /api/contact and /health behind nginx. Compose and every variable are in Getting started.
- Getting started:
docker run, Docker Compose, and the health check - Configuration: every environment variable
- Usage: the contact API and an HTML form example
- Troubleshooting: SMTP and Turnstile failures, and what to put in a bug report