[服务搭建]通过Docker部署Gitlab服务

最近帮不少人搭建Gitlab,由于Docker部署比较方便,而且迁移比较容易,所以把Gitlab部署有关的配置和经验写在这里,供老师同学们参考。

硬件要求

CPU:4C

内存:8G

硬盘:20G

Docker-compose

version: "3"
services:
    gitlab:
        image: 'gitlab/gitlab-ce:latest'
        restart: always
        container_name: 'ncwu-gitlab'
        ports:
            - '3000:80'
            - '5000:5000'
            - '2222:22'
        environment:
            GITLAB_OMNIBUS_CONFIG: |
                external_url = "http://[Your_IP]:3000"
                registry_external_url = 'http://[Your_IP]:5000'
                gitlab_rails['gitlab_shell_ssh_port'] = 23
                gitlab_rails['time_zone'] = 'Asia/Shanghai'
                nginx['listen_port'] = 80
                nginx['listen_https'] = false
                registry_nginx['listen_port'] = 5000
                registry_nginx['listen_https'] = false
                nginx['redirect_http_to_https'] = false
                registry_nginx['redirect_http_to_https'] = false

        volumes:
            - './gitlab/config:/etc/gitlab'
            - './gitlab/logs:/var/log/gitlab'
            - './gitlab/data:/var/opt/gitlab'
        networks:
            - gitlab_net

networks:
    gitlab_net:

启动

docker-compose up -d

 

 

 

 

 

 

 

 

 

 

[服务搭建]通过Docker部署Gitlab服务

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

滚动到顶部