template.yaml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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.5.4-ce.0
  27. author: Christian Lempa
  28. date: '2025-12-11'
  29. tags:
  30. - traefik
  31. - swarm
  32. next_steps: |
  33. ## Post-Installation Steps
  34. 1. **Start GitLab**:
  35. ```bash
  36. docker compose up -d
  37. ```
  38. 2. **Wait for initialization** (2-5 minutes):
  39. ```bash
  40. docker compose logs -f gitlab
  41. ```
  42. Wait for message: `gitlab Reconfigured!`
  43. 3. **Access the web interface**:
  44. {% if traefik_enabled -%}
  45. - Via Traefik: https://{{ traefik_host }}
  46. {% if not traefik_enabled and network_mode == 'bridge' %}- Direct access: http://localhost:{{ ports_http }}{% endif %}
  47. {%- else -%}
  48. - Open {{ external_url }} in your browser
  49. {% if network_mode == 'bridge' %}- Or: http://localhost:{{ ports_http }}{% endif %}
  50. {%- endif %}
  51. 4. **Initial login credentials**:
  52. - **Username**: `root`
  53. - **Password**: `{{ root_password }}`
  54. > **Important**: This password only works on FIRST initialization.
  55. > Change it immediately after first login via GitLab's web interface!
  56. 5. **Configure SSH** (optional):
  57. - SSH clone URLs will use port `{{ ports_ssh }}`
  58. - Update your Git remote if needed
  59. ## Additional Resources
  60. - Documentation: https://docs.gitlab.com/
  61. - GitLab Runner: https://docs.gitlab.com/runner/
  62. draft: true
  63. schema: "1.2"
  64. spec:
  65. general:
  66. vars:
  67. service_name:
  68. default: "gitlab"
  69. external_url:
  70. type: str
  71. description: External URL for GitLab
  72. default: http://localhost
  73. root_email:
  74. type: str
  75. description: Initial root user email address
  76. default: admin@example.com
  77. root_password:
  78. type: str
  79. description: Initial root user password (only used on first initialization)
  80. sensitive: true
  81. autogenerated: true
  82. extra: "Leave empty to auto-generate. WARNING: Only sets password on FIRST startup!"
  83. default_theme:
  84. type: int
  85. description: Default GitLab UI theme (2 = dark mode)
  86. default: 2
  87. extra: "1 = Indigo, 2 = Dark, 3 = Light, 4 = Blue, 5 = Green"
  88. default_color_mode:
  89. type: int
  90. description: Default color mode (2 = dark mode)
  91. default: 2
  92. extra: "1 = Light, 2 = Dark"
  93. disable_usage_data:
  94. type: bool
  95. description: Disable product usage metrics upload to GitLab
  96. default: true
  97. ports:
  98. vars:
  99. ports_ssh:
  100. default: 2424
  101. ports_registry:
  102. type: int
  103. description: Container Registry port
  104. default: 5000
  105. network:
  106. vars:
  107. network_name:
  108. default: "gitlab_network"
  109. traefik:
  110. vars:
  111. traefik_host:
  112. default: gitlab.home.arpa
  113. traefik_registry_host:
  114. needs: ["registry_enabled=true"]
  115. default: registry.home.arpa
  116. type: str
  117. description: Hostname for Container Registry in Traefik (if enabled)
  118. registry:
  119. description: GitLab Container Registry configuration
  120. toggle: registry_enabled
  121. vars:
  122. registry_enabled:
  123. type: bool
  124. description: Enable GitLab Container Registry
  125. default: false
  126. registry_external_url:
  127. type: str
  128. description: External URL for Container Registry
  129. default: http://localhost:5000
  130. advanced:
  131. title: Advanced Settings
  132. description: Performance tuning and advanced configuration options
  133. vars:
  134. performance_preset:
  135. type: enum
  136. description: Performance optimization profile
  137. options:
  138. - homelab
  139. - default
  140. default: homelab
  141. extra: homelab is optimized for low-resource environments, default is for standard servers
  142. prometheus_enabled:
  143. type: bool
  144. description: Enable Prometheus monitoring
  145. default: false
  146. extra: Disabling saves ~200-400MB RAM. GitLab UI metrics will be unavailable.