forked from tldr-devops/startpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitlab.yml
132 lines (122 loc) · 4.31 KB
/
gitlab.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
version: '3.8'
x-gitlab-labels: &gitlab-labels
labels:
- traefik.enable=true
- traefik.docker.network=gitlab
- traefik.http.routers.gitlab-http.rule=Host(`gitlab.${DOMAIN?Variable DOMAIN not set}`)
- traefik.http.routers.gitlab-http.entrypoints=http
- traefik.http.routers.gitlab-http.service=gitlab
- traefik.http.routers.gitlab-http.middlewares=https-redirect
- traefik.http.routers.gitlab-https.rule=Host(`gitlab.${DOMAIN?Variable DOMAIN not set}`)
- traefik.http.routers.gitlab-https.entrypoints=https
- traefik.http.routers.gitlab-https.tls=true
- traefik.http.routers.gitlab-https.service=gitlab
- traefik.http.routers.gitlab-https.tls.certresolver=le
- traefik.http.services.gitlab.loadbalancer.server.port=80
x-service: &service
logging:
driver: json-file
options:
max-size: "100m"
max-file: "2"
restart: always
networks:
- gitlab
- database
services:
# https://hub.docker.com/r/gitlab/gitlab-ce
# https://docs.gitlab.com/ee/install/docker.html
# https://docs.gitlab.com/ee/administration/environment_variables.html
# https://github.com/gitlabhq/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
# https://docs.gitlab.com/ee/administration/monitoring/prometheus/
gitlab:
container_name: gitlab
image: gitlab/gitlab-ce
deploy:
mode: replicated
replicas: 1
resources:
reservations:
cpus: '0.10'
memory: 2900M
<<: *gitlab-labels
<<: *gitlab-labels
<<: *service
ports:
- '2222:22'
environment:
EXTERNAL_URL: https://gitlab.${DOMAIN?Variable DOMAIN not set}
GITLAB_HOST: https://gitlab.${DOMAIN?Variable DOMAIN not set}
DATABASE_URL: "postgres://gitlab:${GITLAB_SQL_PASSWORD?Variable GITLAB_SQL_PASSWORD not set}@postgres:5432/gitlab"
GITLAB_ROOT_PASSWORD: ${PASSWORD?Variable PASSWORD not set}
GITLAB_SHARED_RUNNERS_REGISTRATION_TOKEN: ${HASHED_PASSWORD?Variable HASHED_PASSWORD not set}
GITLAB_OMNIBUS_CONFIG: |
# Add any other gitlab.rb configuration here, each on its own line
nginx['enable'] = true
nginx['listen_port'] = 80
nginx['listen_https'] = false
gitlab_rails['gitlab_shell_ssh_port'] = 2222
### GitLab database settings
###! Docs: https://docs.gitlab.com/omnibus/settings/database.html
gitlab_rails['db_adapter'] = "postgresql"
gitlab_rails['db_database'] = "gitlab"
gitlab_rails['db_username'] = "gitlab"
gitlab_rails['db_password'] = "${GITLAB_SQL_PASSWORD?Variable GITLAB_SQL_PASSWORD not set}"
gitlab_rails['db_host'] = "postgres"
gitlab_rails['db_port'] = 5432
#### Redis TCP connection
# gitlab_rails['redis_host'] = "127.0.0.1"
# gitlab_rails['redis_port'] = 6379
# gitlab_rails['redis_ssl'] = false
# gitlab_rails['redis_password'] = nil
# gitlab_rails['redis_database'] = 0
# gitlab_rails['redis_enable_client'] = true
letsencrypt['enable'] = false
registry['enable'] = false
postgresql['enable'] = false
prometheus['enable'] = false
alertmanager['enable'] = false
node_exporter['enable'] = false
redis_exporter['enable'] = false
postgres_exporter['enable'] = false
pgbouncer_exporter['enable'] = false
gitlab_exporter['enable'] = false
prometheus_monitoring['enable'] = false
grafana['enable'] = false
volumes:
- gitlab-configs:/etc/gitlab
- gitlab-logs:/var/log/gitlab
- gitlab-data:/var/opt/gitlab
shm_size: '256m'
user: root
x-volume: &volume
driver: local
x-volume-driver-opts: &volume-driver-opts
type: none
o: bind
volumes:
gitlab-data:
name: gitlab-data
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/gitlab/data
gitlab-configs:
name: gitlab-configs
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/gitlab/configs
gitlab-logs:
name: gitlab-logs
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/gitlab/logs
networks:
gitlab:
name: gitlab
external: true
database:
name: database
external: true