template.yaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. ---
  2. kind: compose
  3. schema: "1.2"
  4. metadata:
  5. name: GitLab
  6. description: |
  7. A **complete DevOps platform** that provides Git repository management, CI/CD pipelines,
  8. issue tracking, and container registry in a single application.
  9. ## Important Configuration Notes
  10. **Performance Presets**:
  11. - `homelab`: Optimized for low-resource environments (limited workers, reduced PostgreSQL buffers)
  12. - `default`: Standard server configuration for production use
  13. **External URL**:
  14. - Set to your public domain (e.g., `https://gitlab.example.com`) for proper clone URLs
  15. - Affects SSH clone URLs and web links in emails/notifications
  16. **Container Registry**:
  17. - Enable if you need private Docker image hosting
  18. - Requires separate external URL (e.g., `https://registry.example.com`)
  19. ## Resources
  20. - **Project**: https://about.gitlab.com/
  21. - **Documentation**: https://docs.gitlab.com/
  22. - **Community**: https://forum.gitlab.com/
  23. version: 18.5.1-ce.0
  24. author: Christian Lempa
  25. date: '2025-10-31'
  26. tags:
  27. - traefik
  28. next_steps: |
  29. ## Post-Installation Steps
  30. 1. **Start GitLab**:
  31. ```bash
  32. docker compose up -d
  33. ```
  34. 2. **Wait for initialization** (2-5 minutes):
  35. ```bash
  36. docker compose logs -f gitlab
  37. ```
  38. Wait for message: `gitlab Reconfigured!`
  39. 3. **Access the web interface**:
  40. {% if traefik_enabled -%}
  41. - Via Traefik: https://{{ traefik_host }}
  42. {% if not traefik_enabled and network_mode == 'bridge' %}- Direct access: http://localhost:{{ ports_http }}{% endif %}
  43. {%- else -%}
  44. - Open {{ external_url }} in your browser
  45. {% if network_mode == 'bridge' %}- Or: http://localhost:{{ ports_http }}{% endif %}
  46. {%- endif %}
  47. 4. **Initial login credentials**:
  48. - **Username**: `root`
  49. - **Password**: `{{ root_password }}`
  50. > **Important**: This password only works on FIRST initialization.
  51. > Change it immediately after first login via GitLab's web interface!
  52. 5. **Configure SSH** (optional):
  53. - SSH clone URLs will use port `{{ ports_ssh }}`
  54. - Update your Git remote if needed
  55. ## Additional Resources
  56. - Documentation: https://docs.gitlab.com/
  57. - GitLab Runner: https://docs.gitlab.com/runner/
  58. spec:
  59. general:
  60. vars:
  61. service_name:
  62. default: "gitlab"
  63. container_name:
  64. default: "gitlab"
  65. container_hostname:
  66. default: "gitlab"
  67. external_url:
  68. type: str
  69. description: External URL for GitLab
  70. default: http://localhost
  71. root_email:
  72. type: str
  73. description: Initial root user email address
  74. default: admin@example.com
  75. root_password:
  76. type: str
  77. description: Initial root user password (only used on first initialization)
  78. sensitive: true
  79. autogenerated: true
  80. extra: "Leave empty to auto-generate. WARNING: Only sets password on FIRST startup!"
  81. default_theme:
  82. type: int
  83. description: Default GitLab UI theme (2 = dark mode)
  84. default: 2
  85. extra: "1 = Indigo, 2 = Dark, 3 = Light, 4 = Blue, 5 = Green"
  86. default_color_mode:
  87. type: int
  88. description: Default color mode (2 = dark mode)
  89. default: 2
  90. extra: "1 = Light, 2 = Dark"
  91. disable_usage_data:
  92. type: bool
  93. description: Disable product usage metrics upload to GitLab
  94. default: true
  95. ports:
  96. vars:
  97. ports_http:
  98. type: int
  99. description: HTTP port
  100. default: 80
  101. ports_https:
  102. type: int
  103. description: HTTPS port
  104. default: 443
  105. ports_ssh:
  106. type: int
  107. description: SSH port
  108. default: 2424
  109. ports_registry:
  110. type: int
  111. description: Container Registry port
  112. default: 5000
  113. network:
  114. vars:
  115. network_name:
  116. default: "gitlab_network"
  117. traefik:
  118. vars:
  119. traefik_host:
  120. default: gitlab.home.arpa
  121. traefik_registry_host:
  122. needs: ["registry_enabled=true"]
  123. default: registry.home.arpa
  124. type: str
  125. description: Hostname for Container Registry in Traefik (if enabled)
  126. registry:
  127. description: GitLab Container Registry configuration
  128. toggle: registry_enabled
  129. vars:
  130. registry_enabled:
  131. type: bool
  132. description: Enable GitLab Container Registry
  133. default: false
  134. registry_external_url:
  135. type: str
  136. description: External URL for Container Registry
  137. default: http://localhost:5000
  138. swarm:
  139. needs: []
  140. vars:
  141. gitlab_root_password_secret_name:
  142. type: str
  143. description: Docker Swarm secret name for root password
  144. default: gitlab_root_password
  145. gitlab_registry_secret_name:
  146. type: str
  147. description: Docker Swarm secret name for registry
  148. default: gitlab_registry_secret
  149. advanced:
  150. title: Advanced Settings
  151. description: Performance tuning and advanced configuration options
  152. vars:
  153. performance_preset:
  154. type: enum
  155. description: Performance optimization profile
  156. options:
  157. - homelab
  158. - default
  159. default: homelab
  160. extra: homelab is optimized for low-resource environments, default is for standard servers
  161. prometheus_enabled:
  162. type: bool
  163. description: Enable Prometheus monitoring
  164. default: false
  165. extra: Disabling saves ~200-400MB RAM. GitLab UI metrics will be unavailable.