-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
110 lines (103 loc) · 3.76 KB
/
compose.yaml
File metadata and controls
110 lines (103 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
networks:
cloudflared:
ipvlan:
driver: ipvlan
name: ${IPVLAN_NETWORK_NAME}
external: true
volumes:
gitlab-data:
name: gitlab-data
gitlab-logs:
name: gitlab-logs
gitlab-config:
name: gitlab-config
services:
cloudflared:
image: cloudflare/cloudflared
restart: always
networks:
cloudflared:
command: tunnel --no-autoupdate run --token ${CLOUDFLARED_TOKEN}
gitlab:
image: gitlab/gitlab-ee:18.9.1-ee.0
restart: always
shm_size: 256m
volumes:
# Use the same timezone of host operating system.
- /etc/localtime:/etc/localtime:ro
# Cron file used to backup gitlab periodically.
- ./backup-cron:/etc/cron.d/backup-cron:ro
# Persistent docker volumes mapping gitlab paths.
- gitlab-config:/etc/gitlab
- gitlab-logs:/var/log/gitlab
- gitlab-data:/var/opt/gitlab
networks:
cloudflared:
ipvlan:
ipv4_address: ${GITLAB_IPV4_ADDRESS}
deploy:
resources:
limits:
memory: 8g
environment:
# The script in GITLAB_POST_RECONFIGURE_SCRIPT is auto executed on startup.
GITLAB_POST_RECONFIGURE_SCRIPT: |
go-crond "/etc/cron.d/backup-cron" &
# Override "/etc/gitlab/gitlab.rb".
GITLAB_OMNIBUS_CONFIG: |
# ----------- #
# url configs
# ----------- #
external_url '${EXTERNAL_URL}'
registry_external_url '${REGISTRY_EXTERNAL_URL}'
# ------------- #
# uncategrozied
# ------------- #
## Disables the following features when creating a new repository.
gitlab_rails['gitlab_default_projects_features_snippets'] = false
## Disables product usage data (only works upon installation).
gitlab_rails['initial_gitlab_product_usage_data'] = false
# -------------------- #
# resource consumption
# -------------------- #
## Disables prometheus to reduce memory usage.
prometheus_monitoring['enable'] = false
# Disables clustered mode (2 by default).
puma['worker_processes'] = 0
# Reduce the number of sidekiq processes (20 by default).
sidekiq['concurrency'] = 4
# ------------- #
# email configs
# ------------- #
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = '${SMTP_ADDRESS}'
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = '${SMTP_USER_NAME}'
gitlab_rails['smtp_password'] = '${SMTP_PASSWORD}'
gitlab_rails['smtp_domain'] = '${SMTP_DOMAIN}'
gitlab_rails['gitlab_email_from'] = '${GITLAB_EMAIL_FROM}'
gitlab_rails['gitlab_email_display_name'] = 'GitLab'
gitlab_rails['gitlab_email_reply_to'] = '${GITLAB_EMAIL_REPLY_TO}'
# -------------- #
# backup configs
# -------------- #
## The duration in seconds to keep backups.
## (2592000 = 60 secs * 60 mins * 24 hrs * 30 days).
gitlab_rails['backup_keep_time'] = 2592000
## Consider using multipart uploads when file size reaches 100MB.
## Enter a number in bytes.
gitlab_rails['backup_multipart_chunk_size'] = 104857600
## Skip parts of the backup. Comma separated.
gitlab_rails['env'] = {
# Types which will be skipped by backup process.
'SKIP' => 'builds,artifacts,pages'
}
## Bucket name
gitlab_rails['backup_upload_remote_directory'] = '${BACKUP_UPLOAD_REMOTE_DIRECTORY}'
## Bucket metadata
gitlab_rails['backup_upload_connection'] = {
'provider' => '${BACKUP_PROVIDER}',
'region' => '${BACKUP_REGION}',
'aws_access_key_id' => '${BACKUP_AWS_ACCESS_KEY_ID}',
'aws_secret_access_key' => '${BACKUP_AWS_SECRET_ACCESS_KEY}'
}