yaml文件:
version: '3.6'
services:
gitlab:
image: 'gitlab/gitlab-ce:13.8.8-ce.0'
restart: always
hostname: 'gitlab-docker'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.abc.com'
gitlab_rails['gitlab_shell_ssh_port'] = 22
prometheus_monitoring['enable'] = false
ports:
- '18081:80'
- '22:22'
volumes:
- './config:/etc/gitlab'
- './logs:/var/log/gitlab'
- './data:/var/opt/gitlab'
- /etc/localtime:/etc/localtime:ro
shm_size: '256m'
container_name: "gitlab"
配置邮件服务,以企业邮箱为例:
编辑config/gitlab.rb 文件,添加一下内容:
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "abc@abc.com"
gitlab_rails['smtp_password'] = "********"
gitlab_rails['smtp_domain'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'abc@abc.com'
备份:
docker exec gitlab gitlab-backup create
恢复
# Stop the processes that are connected to the database
docker exec -it <name of container> gitlab-ctl stop puma
docker exec -it <name of container> gitlab-ctl stop sidekiq
# Verify that the processes are all down before continuing
docker exec -it <name of container> gitlab-ctl status
# Run the restore. NOTE: "_gitlab_backup.tar" is omitted from the name
docker exec -it <name of container> gitlab-backup restore BACKUP=11493107454_2018_04_25_10.6.4-ce
# Restart the GitLab container
docker restart <name of container>
# Check GitLab
docker exec -it <name of container> gitlab-rake gitlab:check SANITIZE=true
官网地址:
网友评论