侧边栏壁纸
博主头像
过去的,未来的博主等级

来日可期!

  • 累计撰写 277 篇文章
  • 累计创建 43 个标签
  • 累计收到 43 条评论

docker-compose一键搭建gitlab

过去的,未来的
2020-04-09 / 0 评论 / 0 点赞 / 802 阅读 / 0 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2020-04-09,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

1、编写docker-compose.yml文件

version: "3"
services:
  gitlab:
    image: gitlab/gitlab-ce
    container_name: gitlab
    restart: always
    hostname: '192.168.31.230'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url "http://192.168.31.230:9090"
        gitlab_rails['gitlab_shell_ssh_port'] = 2222
        gitlab_rails['gitlab_email_enabled'] = true
        gitlab_rails['gitlab_email_from'] = 'xxx@xxxxx.com'
        gitlab_rails['gitlab_email_display_name'] = 'xxx'
        gitlab_rails['gitlab_email_reply_to'] = 'xxxx@xxxxx.com'
        gitlab_rails['smtp_enable'] = true
        gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
        gitlab_rails['smtp_port'] = 465
        gitlab_rails['smtp_user_name'] = "xxx@xxxx.com"
        gitlab_rails['smtp_password'] = "xxxxx"
        gitlab_rails['smtp_domain'] = "smtp.mxhichina.com"
        gitlab_rails['smtp_authentication'] = "login"
        gitlab_rails['smtp_enable_starttls_auto'] = true
        gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
        gitlab_rails['smtp_tls'] = true
    ports:
      - '9090:9090'
      - '2222:22'
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'
    logging:
      driver: "json-file"
      options:
        max-size: "20m"
        max-file: "10"

2、启动

 docker-compose up -d

3、说明

1)其中9090为web管理界面访问端口,
2)首次使用,设置密码,用户名为root
image.png

0

评论区