GitLab Docker Compose SMTP Config not working

Hey, I have a GitLab Docker Container up and running but I have a problem when I try to connect to my mail server. When configuring the SMTP connection in the docker-compose file, GitLab is unable to send any mails. But when I edit the gitlab.rb file with the exact same config, it’s sending the mails.
Hopefully someone can help me figure out what I’m doing wrong.

docker-compose:

web:
  image: 'gitlab/gitlab-ee:latest'
  restart: always
  hostname: '<gitlab_domain>'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url '<gitlab_domain>'
      gitlab_rails['gitlab_shell_ssh_port'] = 2224
      gitlab_rails['smtp_enable'] = true
      gitlab_rails['smtp_address'] = '<smtp_host>'
      gitlab_rails['smtp_port'] = 587
      gitlab_rails['smtp_user_name'] = 'gitlab@<domain>'
      gitlab_rails['smtp_password'] = 'super_secret_password'
      gitlab_rails['smtp_authentication'] = 'login'
      gitlab_rails['smtp_enable_starttls_auto'] = true
      gitlab_rails['gitlab_email_from'] = 'gitlab@<domain>'
      letsencrypt['enabled'] = false
      nginx['redirect_http_to_https'] = false
      nginx['listen_port'] = 80
      nginx['listen_https'] = false
  ports:
    - '9080:80'
    - '9443:443'
    - '2224:22'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'

Hi @fantasia-y
Since it’s TLS the usual thing thats wrong are CA and SSL self-signed certificate issues. I would look at GitLab logs if there is any error.
Otherwise the docker-compose looks fine to me.

I already checked that the connection works and it works when I set it in the gitlab.rb. It seems like the settings from the docker-compose are not applied. The error log just says Gitlab Mail from may not be empty

I kinda solved my problem. I saved the docker-compose file (without changing anything!) on my Mac today and it works now. Don’t know why, but who cares :smiley: