Last active
September 17, 2025 12:49
-
-
Save noobogami/e788572793634437358609f2b88bf9a6 to your computer and use it in GitHub Desktop.
Gitlab Docker Compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| gitlab: | |
| image: gitlab/gitlab-ee:latest | |
| container_name: gitlab | |
| restart: always | |
| hostname: 'gitlab.YOURSITE.com' | |
| environment: | |
| GITLAB_OMNIBUS_CONFIG: | | |
| # Add any other gitlab.rb configuration here, each on its own line | |
| external_url 'https://gitlab.YOURSITE.com' | |
| # Nginx | |
| nginx['listen_port'] = 80 | |
| nginx['listen_https'] = false | |
| nginx['proxy_set_headers'] = { | |
| "X-Forwarded-Proto" => "https", | |
| "X-Forwarded-Ssl" => "on" | |
| } | |
| # Registry | |
| registry_external_url 'https://registry.YOURSITE.com' | |
| gitlab_rails['registry_enabled'] = true | |
| gitlab_rails['registry_host'] = "registry.YOURSITE.com" | |
| # gitlab_rails['registry_port'] = "5050" | |
| gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry" | |
| registry['enable'] = true | |
| registry['storage'] = { | |
| 'filesystem' => { | |
| 'rootdirectory' => '/var/opt/gitlab/gitlab-rails/shared/registry' | |
| } | |
| } | |
| registry['env'] = { | |
| "REGISTRY_HTTP_RELATIVEURLS" => true | |
| } | |
| registry_nginx['client_max_body_size'] = '16000m' | |
| registry_nginx['listen_port'] = 5050 | |
| registry_nginx['listen_https'] = false | |
| registry_nginx['redirect_http_to_https'] = true | |
| registry_nginx['proxy_set_headers'] = { | |
| "X-Forwarded-For" => "$$proxy_add_x_forwarded_for", | |
| "X-Forwarded-Proto" => "https", | |
| "X-Forwarded-Ssl" => "on", | |
| "Host" => "$$http_host" | |
| } | |
| ports: | |
| - '1020:80' | |
| - '1021:443' | |
| - '22:22' | |
| - '1022:5050' | |
| volumes: | |
| - '${GITLAB_HOME}/config:/etc/gitlab' | |
| - '${GITLAB_HOME}/logs:/var/log/gitlab' | |
| - '${GITLAB_HOME}/data:/var/opt/gitlab' | |
| shm_size: '256m' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment