Gitlab部署

Posted by Wh0ami-hy on June 24, 2024

1. Gitlab-CE安装

Docker-Compose方式部署

创建文件docker-compose.yml

version: '3.6'
name: gitlab
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    container_name: gitlab
    restart: always
    hostname: '192.168.163.129'
    privileged: true
    environment:
      TZ: 'Asia/Shanghai'
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.163.129:8929'
        gitlab_rails['time_zone'] = 'Asia/Shanghai'
      GITLAB_ROOT_PASSWORD: 'Ytjt@123' # 这里设置密码,要大小写和数字
    ports:
      - '8929:8929'
      - '443:443'
      - '2424:22'
    volumes:
      - './gitlab/config:/etc/gitlab'
      - './gitlab/logs:/var/log/gitlab'
      - './gitlab/data:/var/opt/gitlab'
    shm_size: '256m'

执行 docker compose up -d

最低服务器要求:2核 2G以上内存,2GB内存运行的时候内存直接爆掉


本站总访问量