docker-compose搭建gitlab服務

゛ゞ旁觀者ヾ發表於2020-12-06

編寫docker-compose.yml檔案

cd /usr/local/docker/gitlab
vi docker-compose.yml

​ 說明:vi 的貼上模式
​ set paste

​ 內容如下

version: '3'
services:
    gitlab:
        image: 'twang2218/gitlab-ce-zh:11.1.4'
        restart: always  # 開機自啟動
        hostname: '192.168.202.253' # 可以是域名
        environment:
            TZ: 'Asia/Shanghai'
            GITLAB_OMNIBUS_CONFIG: |
                external_url 'http://192.168.202.253'
                gitlab_rails['time_zone'] = 'Asia/Shanghai'
                gitlab_rails['gitlab_shell_ssh_port'] = 2222
                unicorn['port'] = 8888
                nginx['listen_port'] = 80
                # 需要配置到 gitlab.rb 中的配置可以在這裡配置,每個配置一行,注意縮排。
                # 比如下面的電子郵件的配置:
                # gitlab_rails['smtp_enable'] = true
                # gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
                # gitlab_rails['smtp_port'] = 465
                # gitlab_rails['smtp_user_name'] = "xxxx@xx.com"
                # gitlab_rails['smtp_password'] = "password"
                # gitlab_rails['smtp_authentication'] = "login"
                # gitlab_rails['smtp_enable_starttls_auto'] = true
                # gitlab_rails['smtp_tls'] = true
                # gitlab_rails['gitlab_email_from'] = 'xxxx@xx.com'
    ports:
        - '80:80'
        - '443:443'
        - '2222:22'
    volumes:
        - ./config:/etc/gitlab
        - ./data:/var/opt/gitlab
        - ./logs:/var/log/gitlab

相關文章