-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
221 lines (218 loc) · 9.45 KB
/
docker-compose.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
version: '3.3'
networks:
backend:
driver: ${DRIVER_NETWORK_BACKEND}
frontend:
driver: ${DRIVER_NETWORK_FRONTEND}
volumes:
postgres:
driver: ${DRIVER_VOLUME_POSTGRES}
services:
# PostgreSQL
postgres:
#restart: always
image: postgres:${POSTGRES_VERSION}
container_name: "postgres"
volumes:
- ${POSTGRES_DATA_PATH}:/var/lib/postgresql/data
- ${POSTGRES_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports:
- "${POSTGRES_PORT}:5432"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
- GITLAB_POSTGRES_INIT=${GITLAB_POSTGRES_INIT}
- GITLAB_POSTGRES_USER=${GITLAB_POSTGRES_USER}
- GITLAB_POSTGRES_PASSWORD=${GITLAB_POSTGRES_PASSWORD}
- GITLAB_POSTGRES_DB=${GITLAB_POSTGRES_DB}
networks:
- backend
# Redis
redis:
#restart: always
image: redis:${REDIS_VERSION}
container_name: "redis"
volumes:
- ${REDIS_DATA_PATH}:/data
- ${REDIS_CONF_PATH}:/usr/local/etc/redis/redis.conf
ports:
- "${REDIS_PORT}:6379"
networks:
- backend
# Traefik
traefik:
image: traefik:${TRAEFIK_VERSION}
container_name: "traefik"
command:
- --api
- --log.level=DEBUG
- --serversTransport.insecureSkipVerify=true
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_MONITORING_HOST}`)"
- "traefik.http.routers.traefik.middlewares=redirect@file"
- "traefik.http.routers.traefik_secure.entrypoints=web-secure"
- "traefik.http.routers.traefik_secure.rule=Host(`${TRAEFIK_MONITORING_HOST}`)"
- "traefik.http.routers.traefik_secure.tls.certresolver=letsencrypt"
- "traefik.http.routers.traefik_secure.service=api@internal"
- "traefik.http.routers.traefik_secure.middlewares=api_auth"
- "traefik.http.middlewares.api_auth.basicauth.users=${TRAEFIK_MONITORING_AUTH_BASIC}"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
ports:
- "${TRAEFIK_SSH_PORT}:2222"
- "${TRAEFIK_HTTP_PORT}:80"
- "${TRAEFIK_WEB_UI_PORT}:8080"
- "${TRAEFIK_HTTPS_PORT}:443"
volumes:
- ${TRAEFIK_HOST_DOCKER_SOCK}:/var/run/docker.sock
- ${TRAEFIK_CONF_PATH}/traefik.toml:/etc/traefik/traefik.toml
- ${TRAEFIK_CONF_PATH}/provider_file.toml:/etc/traefik/provider_file.toml
- ${TRAEFIK_CONF_PATH}/acme.json:/acme.json
networks:
- frontend
- backend
# WhoAmI?
whoami:
image: "containous/whoami"
container_name: "whoami"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.routers.whoami.rule=Host(`${WHOAMI_HOST}`)"
- "traefik.http.routers.whoami.middlewares=redirect@file"
- "traefik.http.routers.whoami_secure.entrypoints=web-secure"
- "traefik.http.routers.whoami_secure.rule=Host(`${WHOAMI_HOST}`)"
- "traefik.http.routers.whoami_secure.tls.certresolver=letsencrypt"
depends_on:
- traefik
networks:
- backend
# Gitlab
gitlab:
#restart: always
image: gitlab/gitlab-ce:${GITLAB_VERSION}
container_name: "gitlab"
hostname: '${GITLAB_HOSTNAME}'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url '${GITLAB_DOMAIN}'
redis['enable'] = false
nginx['redirect_http_to_https'] = false
nginx['listen_https'] = false
nginx['listen_port'] = 80
#nginx['proxy_set_headers'] = {
# 'X-Forwarded-Proto' => 'https',
# 'X-Forwarded-Ssl' => 'on'
#}
nginx['client_max_body_size'] = '2G'
unicorn['worker_timeout'] = 60
unicorn['worker_processes'] = 2
sidekiq['concurrency'] = 15
postgresql['enable'] = false
postgresql['shared_buffers'] = "512MB"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "${GITLAB_SMTP_HOST}"
gitlab_rails['smtp_port'] = "${GITLAB_SMTP_PORT}"
gitlab_rails['smtp_user_name'] = "${GITLAB_SMTP_USERNAME}"
gitlab_rails['smtp_password'] = "${GITLAB_SMTP_PASSWORD}"
gitlab_rails['smtp_domain'] = "${GITLAB_SMTP_DOMAIN}"
gitlab_rails['smtp_authentication'] = "${GITLAB_SMTP_AUTH}"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['gitlab_shell_ssh_port'] = ${GITLAB_HOST_SSH_PORT}
gitlab_rails['db_host'] = '${GITLAB_POSTGRES_HOST}'
gitlab_rails['db_username'] = '${GITLAB_POSTGRES_USER}'
gitlab_rails['db_password'] = '${GITLAB_POSTGRES_PASSWORD}'
gitlab_rails['db_database'] = '${GITLAB_POSTGRES_DB}'
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'utf8'
gitlab_rails['initial_root_password'] = '${GITLAB_ROOT_PASSWORD}'
gitlab_rails['redis_host'] = 'redis'
gitlab_rails['redis_port'] = '${REDIS_PORT}'
gitlab_rails['redis_database'] = 8
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitlab.entrypoints=web"
- "traefik.http.routers.gitlab.rule=Host(`${GITLAB_HOSTNAME}`)"
- "traefik.http.routers.gitlab.middlewares=redirect@file"
- "traefik.http.routers.gitlab_secure.entrypoints=web-secure"
- "traefik.http.routers.gitlab_secure.rule=Host(`${GITLAB_HOSTNAME}`)"
- "traefik.http.routers.gitlab_secure.tls.certresolver=letsencrypt"
- "traefik.http.services.gitlab.loadbalancer.server.port=80"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
# Can't filter TCP traffic on SNI, see link below
# https://community.containo.us/t/routing-ssh-traffic-with-traefik-v2/717/6
- "traefik.tcp.routers.gitlab-ssh.rule=HostSNI(`*`)"
- "traefik.tcp.routers.gitlab-ssh.entrypoints=ssh"
- "traefik.tcp.routers.gitlab-ssh.service=gitlab-ssh-svc"
- "traefik.tcp.services.gitlab-ssh-svc.loadbalancer.server.port=22"
networks:
- backend
volumes:
- ${GITLAB_DATA_CONFIG_PATH}:/etc/gitlab
- ${GITLAB_LOG_PATH}:/var/log/gitlab
- ${GITLAB_DATA_PATH}:/var/opt/gitlab
depends_on:
- redis
- postgres
openldap:
image: osixia/openldap:${OPENLDAP_VERSION}
container_name: "openldap"
command: "--loglevel debug"
environment:
LDAP_ORGANISATION: "${OPENLDAP_ORGANISATION}"
LDAP_DOMAIN: "${OPENLDAP_DOMAIN}"
#LDAP_BASE_DN: "fracto.net"
LDAP_ADMIN_PASSWORD: "${OPENLDAP_ADMIN_PASSWORD}"
tty: true
stdin_open: true
volumes:
- ${OPENLDAP_DATA_PATH}:/var/lib/ldap
- ${OPENLDAP_CONFIG_PATH}:/etc/ldap/slapd.d
ports:
- "${OPENLDAP_LDAP_PORT}:389"
- "${OPENLDAP_LDAPS_PORT}:636"
hostname: "${OPENLDAP_HOSTNAME}"
networks:
- backend
- frontend
phpldapadmin:
image: osixia/phpldapadmin:${PHPLDAPADMIN_VERSION}
container_name: "phpldapadmin"
environment:
PHPLDAPADMIN_LDAP_HOSTS: "openldap"
PHPLDAPADMIN_HTTPS: "${PHPLDAPADMIN_HTTPS}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.phpldapadmin.entrypoints=web"
- "traefik.http.routers.phpldapadmin.rule=Host(`${PHPLDAPADMIN_DOMAIN}`)"
- "traefik.http.routers.phpldapadmin_secure.entrypoints=web-secure"
- "traefik.http.routers.phpldapadmin_secure.rule=Host(`${PHPLDAPADMIN_DOMAIN}`)"
- "traefik.http.routers.phpldapadmin_secure.tls.certresolver=letsencrypt"
- "traefik.http.services.phpldapadmin.loadbalancer.server.port=80"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
depends_on:
- traefik
- openldap
networks:
- backend
- frontend
portainer:
image: portainer/portainer
container_name: "portainer"
volumes:
- ${PORTAINER_DOCKER_SOCK}:/var/run/docker.sock
- ${PORTAINER_DATA_PATH}:/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.entrypoints=web"
- "traefik.http.routers.portainer.rule=Host(`${PORTAINER_DOMAIN}`)"
- "traefik.http.routers.portainer.middlewares=redirect@file"
- "traefik.http.routers.portainer_secure.entrypoints=web-secure"
- "traefik.http.routers.portainer_secure.rule=Host(`${PORTAINER_DOMAIN}`)"
- "traefik.http.routers.portainer_secure.tls.certresolver=letsencrypt"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
networks:
- backend