之前使用 docker-compose 來架設 GitLab:【淺談 Docker 基礎】GitLab 篇:簡易架設
今天則要來簡單記錄一下,如何在 GitLab 設定 Gmail 郵件伺服器
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "{your_account}@gmail.com"
gitlab_rails['smtp_password'] = "{your_password}"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
version: "3.6"
services:
gitlab:
image: gitlab/gitlab-ce:latest
restart: always
privileged: true
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- '~/gitlab/data:/var/opt/gitlab'
- '~/gitlab/logs:/var/log/gitlab'
- '~/gitlab/config:/etc/gitlab'
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "{your_account}@gmail.com"
gitlab_rails['smtp_password'] = "{your_password}"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
docker-compose up -d
若設定沒有問題,之後系統就能正常的發送相關的郵件了