변군이글루

[Docker] GitLab(Omnibus) 컨테이너로 올리기 본문

* 리눅스

[Docker] GitLab(Omnibus) 컨테이너로 올리기

변군 변군이글루 2021. 6. 8. 20:15
728x90
반응형

GitLab(Omnibus) 컨테이너로 올리기

docker-compose 파일 다운로드 및 docker-compose 실행

$ git clone https://github.com/anti1346/docker-gitlab-ce.git

$ cd docker-gitlab-ce

# .env 파일 생성
$ vim .env
GITLAB_HOST=domain_name
GITLAB_EMAIL=email_address

$ docker-compose up -d

$ docker-compose ps
 Name        Command          State                                       Ports                                
---------------------------------------------------------------------------------------------------------------
gitlab   /assets/wrapper   Up (healthy)   22/tcp, 0.0.0.0:2222->2222/tcp, 0.0.0.0:443->443/tcp,                
                                          0.0.0.0:5000->5000/tcp, 0.0.0.0:5001->5001/tcp, 0.0.0.0:80->80/tcp

docker-compose.yml (참고 : https://github.com/anti1346/docker-gitlab-ce)

$ vim docker-compose.yml
version: '3.6'
services:
  gitlab:
    env_file: .env
    image: gitlab/gitlab-ce:latest
    container_name: gitlab
    hostname: ${GITLAB_HOST}
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://${GITLAB_HOST}'
        gitlab_rails['gitlab_shell_ssh_port'] = 2222
        gitlab_rails['time_zone'] = 'Asia/Seoul'
        nginx['redirect_http_to_https'] = true
        nginx['redirect_http_to_https_port'] = 80
        #nginx['ssl_certificate'] = "/etc/gitlab/ssl/${GITLAB_HOST}.crt"
        #nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/${GITLAB_HOST}.key"
        registry['enable'] = true
        registry_nginx['redirect_http_to_https'] = true
        registry_external_url 'https://${GITLAB_HOST}:5000'
        letsencrypt['enable'] = true
        letsencrypt['contact_emails'] = ['${GITLAB_EMAIL}']
        letsencrypt['auto_renew'] = true
        letsencrypt['auto_renew_hour'] = "12"
        letsencrypt['auto_renew_minute'] = "30"
        letsencrypt['auto_renew_day_of_month'] = "*/15"
        #backup
        gitlab_rails['backup_path'] = '/var/opt/gitlab/backups'
        gitlab_rails['backup_keep_time'] = 604800
        gitlab_rails['backup_archive_permissions'] = 0644
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./gitlab/config:/etc/gitlab:rw
      - ./gitlab/data:/var/opt/gitlab:rw
      - ./gitlab/logs:/var/log/gitlab:rw
      - ./gitlab/backups:/var/opt/gitlab/backups
    ports:
      - 80:80
      - 443:443
      - 2222:2222
      - 5000:5000

GitLab 웹 페이지

 

728x90
반응형
0 Comments
댓글쓰기 폼