这里部署的是目前最新的16.4.1版本
docker版本
Client: Docker Engine - Community
Version: 24.0.6
API version: 1.43
Go version: go1.20.7
Git commit: ed223bc
Built: Mon Sep 4 12:31:44 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.6
API version: 1.43 (minimum version 1.12)
Go version: go1.20.7
Git commit: 1a79695
Built: Mon Sep 4 12:31:44 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.24
GitCommit: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
runc:
Version: 1.1.9
GitCommit: v1.1.9-0-gccaecfc
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker compose版本
docker compose version
Docker Compose version v2.21.0
因为现在docker compose工具已经合并到docker客户端中来了,所以不用单独安装docker compose工具
docker-compose.yaml文件
version: '3.6'
services:
web:
image: 'registry.gitlab.cn/omnibus/gitlab-jh:latest'
restart: always
hostname: 'gitlab.example.com'
container_name: gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
# gitlab.rb的其他配置项都可以加在这个地方 每个参数一行
external_url 'http://192.168.140.80:12345' #ip和端口都是宿主机的ip端口
gitlab_rails['gitlab_shell_ssh_port'] = 22
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xxxxxxxxxxxxx@163.com"
gitlab_rails['smtp_password'] = "xxxxxxxxxxxxxxx" #授权码
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'xxxxxxxxxxxxxx@163.com' #发送邮件的邮箱
gitlab_rails['gitlab_email_display_name'] = 'gitAdmin' #邮件显示的名字
gitlab_rails['gitlab_email_reply_to'] = 'xxxxxxxxxx@163.com' #回复邮件的邮箱
gitlab_rails['gitlab_ssh_host'] = '192.168.140.80' #宿主机的ip
ports:
# 这个端口是web的端口,务必保证容器和宿主机的端口一致
- '12345:12345'
# 这个是使用ssh拉取上传的端口,需要对外开放的
- '22:22'
volumes:
- './config:/etc/gitlab'
- './logs:/var/log/gitlab'
- './data:/var/opt/gitlab'
shm_size: '4g'
ulimits:
nproc: 65535
nofile:
soft: 20000
hard: 40000
gitlab是非常吃内存的,所以宿主机需要内存高点,我这里给的是16G内存
这里的镜像是国内版本极狐的版本,也可以使用官方社区版本 CE版本,docker compose文件的差别不大
参考地址 https://docs.gitlab.cn/jh/install/docker.html#使用-docker-compose-安装极狐gitlab
标签:compose,gitlab,smtp,rails,version,docker From: https://www.cnblogs.com/guangdelw/p/17774854.html