Bootstrap

centos7 使用 docker 部署 gitlab + gitlab-runner

快速配置应用

docker-compose.yml

使用 docker-composedocker 容器集群进行快速编排

获取 docker-gitlabdocker-compose.yml 配置文件,进行快速构建

$ wget https://raw.githubusercontent.com/sameersbn/docker-gitlab/master/docker-compose.yml

获取 docker-compose.yml 文件后,进行自定义配置。

配置环境

打开 docker-compose.yml 文件,针对 gitlab 进行环境配置

version: '2.3'

services:
  
  ...
  # 省略显示其他服务
  ...
  
  gitlab:
    restart: always
    image: sameersbn/gitlab:13.0.6
    depends_on:
    - redis
    - postgresql
    ports:
    - "10080:80"
    - "10022:22"
    volumes:
    - gitlab-data:/home/git/data:Z
    healthcheck:
      test: ["CMD", "/usr/local/sbin/healthcheck"]
      interval: 5m
      timeout: 10s
      retries: 3
      start_period: 5m
    environment:
    - DEBUG=false

    - DB_ADAPTER=postgresql
    - DB_HOST=postgresql
    - DB_PORT=5432
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_NAME=gitlabhq_production

    - REDIS_HOST=redis
    - REDIS_PORT=6379

    - TZ=Asia/Kolkata
    - GITLAB_TIMEZONE=Kolkata

    - GITLAB_HTTPS=false
    - SSL_SELF_SIGNED=false

    - GITLAB_HOST=localhost
    - GITLAB_PORT=10080
    - GITLAB_SSH_PORT=10022
    - GITLAB_RELATIVE_URL_ROOT=
    - GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alphanumeric-string
    - GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alphanumeric-string
    - GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alphanumeric-string

    ...
    # 省略其他配置
    ...

参考配置文档,我们需要将时区设置为东八时区,设

;