fix(gitlab-ce): serve on the generated domain (remove removed unicorn config, pin omnibus)

The template set unicorn['worker_processes'] / unicorn['worker_timeout'] in
GITLAB_OMNIBUS_CONFIG. Unicorn was removed in GitLab 14.0, so on current
gitlab-ce images `gitlab-ctl reconfigure` aborts with "Removed configurations
found in gitlab.rb" and GitLab never starts serving — the generated domain
returned 502 Bad Gateway (issue #380).

Rewrite the template as the official all-in-one Omnibus setup:
- pin gitlab/gitlab-ce:19.1.2-ce.0 instead of :latest
- external_url http://<domain> with nginx listen_port 80 / listen_https false
  (TLS terminates at Traefik)
- set gitlab_rails['initial_root_password'] from a generated template password
- puma single mode + prometheus monitoring off to keep memory reasonable
- drop the external postgres/redis containers (Omnibus bundles and manages
  its own) and the broken ports entries ("2224" published a random host port
  while sshd listens on 22)

Verified on a live Dokploy instance: domain serves the GitLab sign-in page
and root login with the generated password works.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mauricio Siu
2026-07-14 11:11:25 -06:00
parent 17efd705a4
commit 8f84a52855
3 changed files with 9 additions and 54 deletions

View File

@@ -1,65 +1,24 @@
services:
gitlab:
image: gitlab/gitlab-ce:latest
image: gitlab/gitlab-ce:19.1.2-ce.0
restart: unless-stopped
hostname: gitlab.example.com
shm_size: "256m"
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://${GITLAB_HOST}'
gitlab_rails['gitlab_ssh_host'] = '${GITLAB_HOST}'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_host'] = 'postgresql'
gitlab_rails['db_port'] = '5432'
gitlab_rails['db_database'] = '${POSTGRES_DB}'
gitlab_rails['db_username'] = '${POSTGRES_USER}'
gitlab_rails['db_password'] = '${POSTGRES_PASSWORD}'
# Redis config for external TCP connection
gitlab_rails['redis_url'] = 'redis://redis:6379/0'
gitlab_rails['redis_host'] = 'redis'
gitlab_rails['redis_port'] = 6379
gitlab_rails['redis_socket'] = nil
gitlab_rails['gitlab_email_enabled'] = false
gitlab_rails['gitlab_default_can_create_group'] = true
gitlab_rails['gitlab_username_changing_enabled'] = false
unicorn['worker_processes'] = 2
unicorn['worker_timeout'] = 60
postgresql['enable'] = false
redis['enable'] = false
nginx['enable'] = true
nginx['listen_port'] = 80
nginx['listen_https'] = false
gitlab_rails['initial_root_password'] = '${GITLAB_ROOT_PASSWORD}'
gitlab_rails['gitlab_email_enabled'] = false
puma['worker_processes'] = 0
sidekiq['concurrency'] = 10
prometheus_monitoring['enable'] = false
ports:
- "80"
- "2224"
volumes:
- gitlab_config:/etc/gitlab
- gitlab_logs:/var/log/gitlab
- gitlab_data:/var/opt/gitlab
depends_on:
- postgresql
- redis
postgresql:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgresql_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redis_data:/data
volumes:
gitlab_config:
gitlab_logs:
gitlab_data:
postgresql_data:
redis_data:

View File

@@ -1,7 +1,7 @@
{
"id": "gitlab-ce",
"name": "GitLab CE",
"version": "latest",
"version": "19.1.2",
"description": "GitLab Community Edition is a free and open source platform for managing Git repositories, CI/CD pipelines, and project management.",
"logo": "gitlab-ce.svg",
"links": {

View File

@@ -1,15 +1,11 @@
[variables]
main_domain = "${domain}"
postgres_db = "gitlab"
postgres_user = "gitlab"
postgres_password = "${password:32}"
gitlab_root_password = "${password:32}"
[config]
env = [
"GITLAB_HOST=${main_domain}",
"POSTGRES_DB=${postgres_db}",
"POSTGRES_USER=${postgres_user}",
"POSTGRES_PASSWORD=${postgres_password}",
"GITLAB_ROOT_PASSWORD=${gitlab_root_password}",
]
[[config.domains]]