赞
踩
前面有讲过基于ip地址通过openssl生成自签名证书的操作,本篇为大家介绍下为gitlab配置自签证书。
这里是通过docker-dompose拉取的一套服务,需要需要提前安装docker-compose和docker。
cat gitlab.yml
version: '3' services: gitlab: image: registry.gitlab.cn/omnibus/gitlab-jh:15.5.9 restart: always hostname: '192.168.31.40' container_name: gitlab environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://192.168.31.40:19090' nginx['redirect_http_to_https'] = true letsencrypt['enable'] = false nginx['ssl_certificate'] = "/etc/gitlab/ssl/server.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/server.key" # 配置ssh协议所使用的访问地址和端口 gitlab_rails['gitlab_ssh_host'] = '192.168.31.40' gitlab_rails['gitlab_shell_ssh_port'] = 2022 # 此端口是run时22端口映射的8090端口 #禁用不需要的服务 node_exporter['enable'] = false redis_exporter['enable'] = false postgres_exporter['enable'] = false gitlab_exporter['enable'] = false prometheus['enable'] = false gitlab_kas['enable'] = false alertmanager['enable'] = false ports: - '19090:19090' - '2022:22' volumes: - /root/gitlab/data:/var/opt/gitlab - /root/gitlab/logs:/var/log/gitlab - /root/gitlab/config:/etc/gitlab - /etc/localtime:/etc/localtime
docker-compose -f gitlab.yml up -d
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。