template.yaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. ---
  2. kind: compose
  3. metadata:
  4. name: GitLab
  5. description: |-
  6. A **complete DevOps platform** that provides Git repository management, CI/CD pipelines,
  7. issue tracking, and container registry in a single application.
  8. ## Prerequisites
  9. - ...
  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. icon:
  24. provider: selfh
  25. id: gitlab
  26. version: 18.8.4-ce.0
  27. author: Christian Lempa
  28. date: '2026-02-10'
  29. tags:
  30. - traefik
  31. next_steps: |-
  32. ## Post-Installation Steps
  33. 1. **Start GitLab**:
  34. ```bash
  35. docker compose up -d
  36. ```
  37. 2. **Wait for\
  38. \ initialization** (2-5 minutes):
  39. ```bash
  40. docker compose logs -f gitlab
  41. ```
  42. Wait for message: `gitlab\
  43. \ Reconfigured!`
  44. 3. **Access the web interface**:
  45. {% if traefik_enabled -%}
  46. - Via Traefik: https://{{ traefik_host\
  47. \ }}
  48. {% if not traefik_enabled and network_mode == 'bridge' %}- Direct access: http://localhost:{{ ports_http }}{%\
  49. \ endif %}
  50. {%- else -%}
  51. - Open {{ external_url }} in your browser
  52. {% if network_mode == 'bridge' %}- Or: http://localhost:{{\
  53. \ ports_http }}{% endif %}
  54. {%- endif %}
  55. 4. **Initial login credentials**:
  56. - **Username**: `root`
  57. - **Password**:\
  58. \ `{{ root_password }}`
  59. > **Important**: This password only works on FIRST initialization.
  60. > Change it immediately\
  61. \ after first login via GitLab's web interface!
  62. 5. **Configure SSH** (optional):
  63. - SSH clone URLs will use port `{{\
  64. \ ports_ssh }}`
  65. - Update your Git remote if needed
  66. ## Additional Resources
  67. - Documentation: https://docs.gitlab.com/
  68. \
  69. - GitLab Runner: https://docs.gitlab.com/runner/
  70. schema: '1.2'
  71. spec:
  72. general:
  73. vars:
  74. service_name:
  75. type: str
  76. description: Docker service name
  77. default: gitlab
  78. external_url:
  79. type: str
  80. description: External URL for GitLab
  81. default: http://localhost
  82. root_email:
  83. type: str
  84. description: Initial root user email address
  85. default: admin@example.com
  86. root_password:
  87. type: str
  88. description: Initial root user password (only used on first initialization)
  89. sensitive: true
  90. autogenerated: true
  91. extra: 'Leave empty to auto-generate. WARNING: Only sets password on FIRST startup!'
  92. default_theme:
  93. type: int
  94. description: Default GitLab UI theme (2 = dark mode)
  95. default: 2
  96. extra: 1 = Indigo, 2 = Dark, 3 = Light, 4 = Blue, 5 = Green
  97. default_color_mode:
  98. type: int
  99. description: Default color mode (2 = dark mode)
  100. default: 2
  101. extra: 1 = Light, 2 = Dark
  102. disable_usage_data:
  103. type: bool
  104. description: Disable product usage metrics upload to GitLab
  105. default: true
  106. restart_policy:
  107. type: enum
  108. options:
  109. - unless-stopped
  110. - always
  111. - on-failure
  112. - 'no'
  113. default: unless-stopped
  114. required: true
  115. advanced:
  116. title: Advanced Settings
  117. description: Performance tuning and advanced configuration options
  118. vars:
  119. performance_preset:
  120. type: enum
  121. description: Performance optimization profile
  122. options:
  123. - homelab
  124. - default
  125. default: homelab
  126. extra: homelab is optimized for low-resource environments, default is for standard servers
  127. prometheus_enabled:
  128. type: bool
  129. description: Enable Prometheus monitoring
  130. default: false
  131. extra: Disabling saves ~200-400MB RAM. GitLab UI metrics will be unavailable.
  132. ports:
  133. vars:
  134. ports_http:
  135. default: 80
  136. ports_ssh:
  137. default: 2424
  138. ports_registry:
  139. type: int
  140. description: Container Registry port
  141. default: 5000
  142. registry:
  143. description: GitLab Container Registry configuration
  144. toggle: registry_enabled
  145. vars:
  146. registry_enabled:
  147. type: bool
  148. description: Enable GitLab Container Registry
  149. default: false
  150. registry_external_url:
  151. type: str
  152. description: External URL for Container Registry
  153. default: http://localhost:5000
  154. traefik:
  155. vars:
  156. traefik_host:
  157. default: gitlab.home.arpa
  158. traefik_registry_host:
  159. needs:
  160. - registry_enabled=true
  161. default: registry.home.arpa
  162. type: str
  163. description: Hostname for Container Registry in Traefik (if enabled)
  164. traefik_network:
  165. default: traefik
  166. type: str
  167. required: true
  168. traefik_domain:
  169. default: home.arpa
  170. type: str
  171. required: true
  172. traefik_enabled:
  173. type: bool
  174. default: false
  175. description: Enable Traefik integration
  176. traefik_tls:
  177. vars:
  178. traefik_tls_certresolver:
  179. type: str
  180. default: cloudflare
  181. required: true
  182. traefik_tls_enabled:
  183. type: bool
  184. default: false
  185. description: Enable Traefik TLS
  186. email:
  187. toggle: email_enabled
  188. vars:
  189. email_enabled:
  190. type: bool
  191. default: false
  192. description: Enable email server configuration
  193. email_host:
  194. type: str
  195. default: ''
  196. description: SMTP server hostname
  197. email_port:
  198. type: int
  199. default: 587
  200. description: SMTP server port
  201. email_username:
  202. type: str
  203. default: ''
  204. description: SMTP username
  205. email_password:
  206. type: str
  207. sensitive: true
  208. default: ''
  209. description: SMTP password
  210. email_from:
  211. type: str
  212. default: ''
  213. description: From email address
  214. email_use_tls:
  215. type: bool
  216. default: true
  217. description: Use TLS encryption
  218. email_use_ssl:
  219. type: bool
  220. default: false
  221. description: Use SSL encryption
  222. authentik:
  223. toggle: authentik_enabled
  224. vars:
  225. authentik_enabled:
  226. type: bool
  227. default: false
  228. description: Enable Authentik SSO integration
  229. authentik_url:
  230. type: str
  231. default: https://auth.home.arpa
  232. description: Authentik base URL (e.g., https://auth.example.com)
  233. authentik_slug:
  234. type: str
  235. default: gitlab
  236. description: Authentik application slug
  237. authentik_client_id:
  238. type: str
  239. default: ''
  240. description: OAuth client ID from Authentik provider
  241. authentik_client_secret:
  242. type: str
  243. sensitive: true
  244. default: ''
  245. description: OAuth client secret from Authentik provider