使用docker-compose安装GitLab中文社区版

一、安装docker-compose

参考文章《Harbor-企业级docker私服管理

二、编写docker-compose.yml

version: '3'
services:
  gitlab:
    image: 'twang2218/gitlab-ce-zh:latest'
    restart: always 
    hostname: '192.168.0.130'
    environment:
       TZ: 'Asia/Shanghai'
       GITLAB_OMNIBUS_CONFIG: |
           external_url 'http://192.168.0.130:8090'
           gitlab_rails['smtp_enable'] = true
           gitlab_rails['smtp_address'] = "smtp.163.com"
           gitlab_rails['smtp_port'] = 25
           gitlab_rails['smtp_user_name'] = "****@163.com"
           gitlab_rails['smtp_password'] = "****"   #163生成的客户端授权码 非邮箱密码
           gitlab_rails['smtp_domain'] = "163.com"
           gitlab_rails['smtp_authentication'] = :login
           gitlab_rails['smtp_enable_starttls_auto'] = true
           gitlab_rails['gitlab_email_from'] = "****@163.com"
           user["git_user_email"] = "****@163.com"
           nginx['listen_port'] = 8090
    ports:
      - '8090:8090'
      - '8443:443'
      - '2222:22'
    volumes:
      - /srv/gitlab-zh/config:/etc/gitlab
      - /srv/gitlab-zh/logs:/var/log/gitlab
      - /srv/gitlab-zh/data:/var/opt/gitlab

坑!
阿里云服务器gitlab邮箱配置OpenTimeout: execution expired,阿里云服务器默认是屏蔽25端口的,改用163邮箱的465端口即可。

gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_tls'] = true

三、执行

在docker-compose.yml所在目录执行:

$ docker-conpose up


查看正在运行的docker-compose容器:

$ docker-compose ps

四、web界面访问

网址:192.168.0.130:8090

更多GitLab界面操作请看《GitLab-docker中的安装与实践

©️2020 CSDN 皮肤主题: 像素格子 设计师:CSDN官方博客 返回首页