He seguido el popular proxy inverso Dockerised Nginxconfiguraciónpara que mi VPS aloje múltiples sitios o aplicaciones en forma de contenedores. Actualmente, funciona bien y puedo publicar mi contenido estático.
Aunque, en este momento, estoy en el proceso de configurar Gitlab nuevamente como contenedor, pero sigue fallando al generar un 502 Bad Gateway
error cuando visito la URL después de iniciar el contenedor.
docker-compose.yml
:
version: "3"
services:
gitlab:
image: gitlab/gitlab-ce:latest
container_name: gitlab
restart: unless-stopped
expose:
- 80
hostname: "gitlab.mydomain.com"
environment:
VIRTUAL_HOST: gitlab.mydomain.com
LETSENCRYPT_HOST: gitlab.mydomain.com
LETSENCRYPT_EMAIL: [email protected]
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.mydomain.com'
volumes:
- /srv/gitlab/config:/etc/gitlab
- /srv/gitlab/logs:/var/log/gitlab
- /srv/gitlab/data:/var/opt/gitlab
networks:
default:
external:
name: nginx-proxy
Cuando reviso los registros del contenedor, aquí está el registro completo, pero básicamente se queja de que external_url
no está configurado correctamente y Chef Intra Client
no se puede iniciar.
================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
================================================================================
RuntimeError
------------
GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:105:in `parse_external_url'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:36:in `parse_variables'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:187:in `block in generate_config'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:185:in `each'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:185:in `generate_config'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:24:in `from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in `from_file'
Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:
98: end
99:
100: def parse_external_url
101: return unless Gitlab['external_url']
102:
103: uri = URI(Gitlab['external_url'].to_s)
104:
105>> raise "GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/" unless uri.host
106:
107: Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
108: Gitlab['gitlab_rails']['gitlab_host'] = uri.host
109: Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
110:
111: case uri.scheme
112: when "http"
113: Gitlab['gitlab_rails']['gitlab_https'] = false
114: Nginx.parse_proxy_headers('nginx', false)
System Info:
------------
chef_version=15.14.0
platform=ubuntu
platform_version=16.04
ruby=ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client
Running handlers:
Running handlers complete
Chef Infra Client failed. 0 resources updated in 05 seconds
There was an error running gitlab-ctl reconfigure:
GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/
Thank you for using GitLab Docker Image!
Current version: gitlab-ce=13.7.1-ce.0
Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:
docker exec -it gitlab vim /etc/gitlab/gitlab.rb
docker restart gitlab
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
If this container fails to start due to permission problems try to fix it by executing:
docker exec -it gitlab update-permissions
docker restart gitlab
Cleaning stale PIDs & sockets
Preparing services...
Starting services...
Configuring GitLab...
/opt/gitlab/embedded/bin/runsvdir-start: line 24: ulimit: pending signals: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
Starting Chef Infra Client, version 15.14.0
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
- gitlab (0.0.1)
- logrotate (0.0.0)
- redis (0.1.0)
- registry (0.1.0)
- mattermost (0.1.0)
- postgresql (0.1.0)
- consul (0.1.0)
- praefect (0.1.0)
- package (0.1.0)
- gitlab-pages (0.1.0)
- letsencrypt (0.1.0)
- nginx (0.1.0)
- runit (5.1.3)
- acme (4.1.1)
- monitoring (0.1.0)
- gitaly (0.1.0)
- crond (0.1.0)
- gitlab-kas (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Lo verifiqué gitlab.rb
ingresando interactivamente al contenedor y está external_url
configurado correctamente, pero por alguna razón no puedo entenderlo, simplemente no funciona.