forked from rbales79/Ansible-Swarm-Deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose-gitlab.yml
97 lines (90 loc) · 3.13 KB
/
compose-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
version: '3.3'
services:
gitlab-runner:
image: gitlab/gitlab-runner:alpine
restart: always
networks:
- traefik-public
- gitlab-runners
volumes:
# Mount Docker socket for dind
- /var/run/docker.sock:/var/run/docker.sock
# We need to slightly modify the runner config, so mount it here and just create an empty file for the beginning
# Make sure that the permissions are correct so that the container can write to it
- gitlab-runner-data:/etc/gitlab-runner
gitlab:
image: gitlab/gitlab-ce:latest
restart: always
hostname: gitlab.rlab.com
healthcheck:
disable: true
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.rlab.com'
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['http2_enabled'] = false
nginx['proxy_set_headers'] = {
"Host" => "$$http_host",
"X-Real-IP" => "$$remote_addr",
"X-Forwarded-For" => "$$proxy_add_x_forwarded_for",
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
gitlab_rails['gitlab_shell_ssh_port'] = 22
registry_external_url 'https://registry.gitlab.rlab.com'
registry_nginx['listen_port'] = 5100
registry_nginx['listen_https'] = false
registry_nginx['proxy_set_headers'] = {
"Host" => "$$http_host",
"X-Real-IP" => "$$remote_addr",
"X-Forwarded-For" => "$$proxy_add_x_forwarded_for",
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
pages_external_url 'https://pages.gitlab.rlab.com'
pages_nginx['listen_port'] = 5200
pages_nginx['listen_https'] = false
pages_nginx['proxy_set_headers'] = {
"Host" => "$$http_host",
"X-Real-IP" => "$$remote_addr",
"X-Forwarded-For" => "$$proxy_add_x_forwarded_for",
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
gitlab_pages['inplace_chroot'] = true
gitlab_pages['external_http'] = ['gitlab:5201']
volumes:
- gitlab-config:/etc/gitlab
- gitlab-logs:/var/log/gitlab
- gitlab-data:/var/opt/gitlab
networks:
- traefik-public
- gitlab-runners
deploy:
labels:
- traefik.frontend.rule=Host:gitlab.rlab.com
- traefik.registry.frontend.rule=Host:registry.gitlab.rlab.com
- traefik.pages.frontend.rule=Host:pages.gitlab.rlab.com
- traefik.pages.port=5201
- traefik.registry.port=5100
- traefik.enable=true
- traefik.port=80
- traefik.tags=traefik-public
- traefik.docker.network=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
networks:
gitlab-runners:
driver: overlay
attachable: true
traefik-public:
external: true
volumes:
gitlab-config:
gitlab-logs:
gitlab-data:
gitlab-runner-data: