美文网首页
Gitlab搭建、备份及还原

Gitlab搭建、备份及还原

作者: HelloWorld_26 | 来源:发表于2018-09-03 17:53 被阅读0次
    参考文档 https://github.com/sameersbn/docker-gitlab#host-key-backups-ssh
    1. Installation
    # cat docker-compose.yml
    postgresql:
      image: sameersbn/postgresql:9.4-3
      environment:
        - DB_USER=gitlab
        - DB_PASS=password
        - DB_NAME=gitlabhq_production
      volumes:
        - /srv/docker/gitlab/postgresql:/var/lib/postgresql
    gitlab:
      image: sameersbn/gitlab:7.13.4
      links:
        - redis:redisio
        - postgresql:postgresql
      ports:
        - "10080:80"
        - "10022:22"
      environment:
        - TZ=Asia/Beijing
        - SMTP_ENABLED=false
        - SMTP_DOMAIN=www.example.com
        - SMTP_HOST=smtp.gmail.com
        - SMTP_PORT=587
        - SMTP_USER=mailer@example.com
        - SMTP_PASS=password
        - SMTP_STARTTLS=true
        - SMTP_AUTHENTICATION=login
        - GITLAB_TIMEZONE=Beijing
        - GITLAB_HOST=192.xx.x.xx
        - GITLAB_PORT=10080
        - GITLAB_SSH_PORT=10022
        - GITLAB_EMAIL=admin@example.com
        - GITLAB_EMAIL_REPLY_TO=noreply@example.com
        - GITLAB_BACKUPS=daily
        - GITLAB_BACKUP_TIME=01:00
      volumes:
        - /srv/docker/gitlab/gitlab:/home/git/data
    redis:
      image: sameersbn/redis:latest
      volumes:
        - /srv/docker/gitlab/redis:/var/lib/redis
    
    1. Creating backups
    # docker-compose run --rm gitlab app:rake gitlab:backup:create
    # ls /srv/docker/gitlab/gitlab/backups/
    1535418030_gitlab_backup.tar
    
    1. Restoring Backups
    # docker-compose run --rm gitlab app:rake gitlab:backup:restore     # List available backups
    # docker-compose run --rm gitlab app:rake gitlab:backup:restore BACKUP=1417624827    # Choose to restore from 1417624827
    

    相关文章

      网友评论

          本文标题:Gitlab搭建、备份及还原

          本文链接:https://www.haomeiwen.com/subject/nteiwftx.html