template.yaml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. ## Prerequisites
  10. - ...
  11. **Performance Presets**:
  12. - `homelab`: Optimized for low-resource environments (limited workers, reduced PostgreSQL buffers)
  13. - `default`: Standard server configuration for production use
  14. **External URL**:
  15. - Set to your public domain (e.g., `https://gitlab.example.com`) for proper clone URLs
  16. - Affects SSH clone URLs and web links in emails/notifications
  17. **Container Registry**:
  18. - Enable if you need private Docker image hosting
  19. - Requires separate external URL (e.g., `https://registry.example.com`)
  20. ## Resources
  21. - **Project**: https://about.gitlab.com/
  22. - **Documentation**: https://docs.gitlab.com/
  23. - **Community**: https://forum.gitlab.com/
  24. icon:
  25. provider: selfh
  26. id: gitlab
  27. version: 18.5.1-ce.0
  28. author: Christian Lempa
  29. date: '2025-10-31'
  30. tags:
  31. - traefik
  32. - swarm
  33. next_steps: |
  34. ## Post-Installation Steps
  35. 1. **Start GitLab**:
  36. ```bash
  37. docker compose up -d
  38. ```
  39. 2. **Wait for initialization** (2-5 minutes):
  40. ```bash
  41. docker compose logs -f gitlab
  42. ```
  43. Wait for message: `gitlab Reconfigured!`
  44. 3. **Access the web interface**:
  45. {% if traefik_enabled -%}
  46. - Via Traefik: https://{{ traefik_host }}
  47. {% if not traefik_enabled and network_mode == 'bridge' %}- Direct access: http://localhost:{{ ports_http }}{% endif %}
  48. {%- else -%}
  49. - Open {{ external_url }} in your browser
  50. {% if network_mode == 'bridge' %}- Or: http://localhost:{{ ports_http }}{% endif %}
  51. {%- endif %}
  52. 4. **Initial login credentials**:
  53. - **Username**: `root`
  54. - **Password**: `{{ root_password }}`
  55. > **Important**: This password only works on FIRST initialization.
  56. > Change it immediately after first login via GitLab's web interface!
  57. 5. **Configure SSH** (optional):
  58. - SSH clone URLs will use port `{{ ports_ssh }}`
  59. - Update your Git remote if needed
  60. ## Additional Resources
  61. - Documentation: https://docs.gitlab.com/
  62. - GitLab Runner: https://docs.gitlab.com/runner/
  63. draft: true
  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.