🐳
GitLab の docker-compose.yml サンプル (LDAP対応)
なぜか、ググってもちょうどいい感じのが見つからないので、自分のを貼っときます。
自分も、大昔に何かをコピペ参考にして作ったはずなんだけど、どこだったんだろう...??
なお、GitLab 用 OpenLDAP の立ちあげ方はこちら:
OpenLDAP のインストールから memberOf オーバーレイの導入まで (Ubuntu 20.04 LTS)
services:
web:
image: 'gitlab/gitlab-ee:15.3.3-ee.0'
restart: always
hostname: 'localhost'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.internal'
letsencrypt['enable'] = false
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/localhost.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/localhost.key"
gitlab_rails['gitlab_shell_ssh_port'] = 10022
gitlab_rails['omniauth_enabled'] = false
gitlab_rails['ldap_enabled'] = true
gitlab_rails['prevent_ldap_sign_in'] = false
gitlab_rails['ldap_sync_worker_cron'] = "*/5 * * * *"
gitlab_rails['ldap_servers'] = YAML.load <<-EOS
main:
label: 'Primary LDAP'
host: 'ldap.internal'
port: 389
uid: 'uid'
encryption: false
verify_certificates: false
bind_dn: 'cn=admin,dc=internal'
password: 'EJgN#NGuyZFb!2@j'
tls_options:
ca_file: ''
ssl_version: ''
ciphers: ''
cert: ''
key: ''
active_directory: false
allow_username_or_email_login: true
block_auto_created_users: false
base: 'dc=internal'
user_filter: ''
lowercase_usernames: true
attributes:
name: 'cn'
group_base : 'ou=gitlab_groups,ou=groups,dc=internal'
admin_group : 'gitlab_admins'
external_groups : []
sync_ssh_keys : false
EOS
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- '/srv/gitlab-ee/config:/etc/gitlab'
- '/srv/gitlab-ee/logs:/var/log/gitlab'
- '/srv/gitlab-ee/data:/var/opt/gitlab'
Discussion