Ghost Blog - SMTP environment variables with Docker/Kubernetes
There is not much resources out there on how to setup a self hosted Ghost blog using Kubernetes and especially how to setup a Mailgun SMTP user.
Kubernetes
To see how to host Ghost blog with kubernetes check out this article: https://igor.technology/installing-ghost-on-digitalocean-with-kubernetes/
Here is simple deploymeny descriptor for Kubernetes with added Mailgun environment variables settings:
Update the deployment descriptor by running: kubectl apply -f deployment.yaml
Docker
Running docker instance uses exact same environement variables as Kuberentes. here is an example:
docker run -d \
-p 3001:2368 \
-v /mylocalfolder/ghost/content:/var/lib/ghost/content \
-e mail__transport="SMTP" \
-e mail__from="Sample <sample@example.com>" \
-e mail__options__service="SMTP" \
-e mail__options__host="smtp.sendgrid.net" \
-e mail__options__port="587" \
-e mail__options__auth__user="username" \
-e mail__options__auth__pass="password" \
ghost