构建HTTP GitLab
version: '3.7'services: web: image: 'gitlab/gitlab-ce:latest' restart: always hostname: '192.168.1.150' environment: TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url 'http://gitlab.hzlim.cn:8080' gitlab_rails['gitlab_shell_ssh_port'] = 2222 nginx['listen_port'] = 8080 ports: - '8080:8080' - '2222:22' volumes: - ./config:/etc/gitlab - ./data:/var/opt/gitlab - ./logs:/var/log/gitlab
构建HTTPS GitLab
version: '3.7'services: web: image: 'gitlab/gitlab-ce:latest' restart: always hostname: '192.168.1.150' environment: TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url 'https://gitlab.hzlim.cn:8443' gitlab_rails['gitlab_shell_ssh_port'] = 2222 nginx['listen_port'] = 8443 nginx['redirect_http_to_https'] = true nginx['ssl_certificate'] = "/etc/gitlab/cert/server.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/cert/server.key" ports: - '8443:8443' - '2222:22' volumes: - ./cert:/etc/gitlab/cert - ./config:/etc/gitlab - ./data:/var/opt/gitlab - ./logs:/var/log/gitl