Backup with docker-compose and AWS S3


docker-compose.yml

version: '3.8' services: web: image: 'gitlab/gitlab-ce:14.2.3-ce.0' hostname: 'version.ice.i-on.net' restart: always container_name: gitlab-ce environment: GITLAB_OMNIBUS_CONFIG: | external_url 'http://version.ice.i-on.net' nginx['redirect_http_to_https'] = false letsencrypt['enable'] = false gitlab_rails['time_zone'] = 'Asia/Seoul' gitlab_rails['gitlab_shell_ssh_port'] = '10022' gitlab_rails['backup_upload_connection'] = { 'provider' => 'AWS', 'region' => '${region}', 'aws_access_key_id' => '${aws_access_key_id}', 'aws_secret_access_key' => '${aws_secret_access_key}', 'use_iam_profile' => false } gitlab_rails['backup_upload_remote_directory'] = 'ice-ops-backup/gitlab/dcsf-dev08' gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = 'smtp.gmail.com' gitlab_rails['smtp_port'] = 587 gitlab_rails['smtp_user_name'] = 'ice@ion.net' gitlab_rails['smtp_password'] = 'dkdldhs!QAZ1' gitlab_rails['smtp_domain'] = 'smtp.gmail.com' gitlab_rails['smtp_authentication'] = 'login' gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_tls'] = false gitlab_rails['smtp_openssl_verify_mode'] = 'peer' ports: - '80:80' - '443:443' - '10022:22' - '5050:5050' volumes: - './etc/gitlab:/etc/gitlab' - './log/gitlab:/var/log/gitlab' - './data/gitlab:/var/opt/gitlab' - './backup/gitlab:/var/opt/gitlab/backups'

.env

region=ap-northeast-2 aws_access_key_id=AKIAAKIAAKIAAKIAAKIA aws_secret_access_key=YIf2YIf2YIf2YIf2YIf2YIf2YIf2YIf2YIf2YIf2

.env 파일은 git track 대상 아님 local, server 에서 직접 생성 해서 사용해야함

작업

$ sudo gitlab-backup create

참조