Mail-Configuration in docker-compose file

Hi Folks,

According to the post I found in this forum (see How to add SMTP (mail) configuration? - #7 by Kevin) I tried to add my mail config for ghost, but it doesn‘t work. Has anybody an idea, what I am doing wrong.

services:

  ghost:
    image: ghost:5-alpine
    restart: always
    networks:
      - traefik
      - default
    env_file: ".env"
    environment:
      database__client: "${DB_TYPE}"
      database__connection__host: "${DB_HOST}"
      database__connection__user: "${DB_USER}"
      database__connection__password: "${DB_PASS}"
      database__connection__database: "${DB_NAME}"
      mail__transport: "SMTP"
      mail__options__host: "${MAILGUN_HOST}"
      mail__options__port: "${MAILGUN_PORT}"
      mail__options__secure: false
      mail__options__auth__user: "${MAILGUN_USER}"
      mail__options__auth__pass: "${MAILGUN_PASS}"
      mail__from: "${MAILGUN_FROM}"
      url: "${BLOG_URL}" 
    volumes:
      - ./data/ghost:/var/lib/ghost/content

Thanks for any help or hint.

Best regards,
Marc

Please share the error messages seen and whether you’re trying to send transactional or bulk.

Hey,

there is no error message. I tried to Sign up an account and I got the message, that the mail could not be sent. I’ve looked into the configuration files and see, that the settings are not written to the prod-config.

Best regards,
Marc

Try signing up as a member again.

If it fails, try running docker compose logs in the directory where your compose file is located. This should give you the error messages on the server (which should be more detailled than what you see on the frontend).

1 Like

Thanks for the hint… I got it running now.

1 Like

I sugges you to use a debian based Ghost image, not alpine, because it has several known networking issues. Just an opinion! Regards