Gitlab CE gibt 502 Bad Gateway hinter Dockerized Nginx Reverse Proxy Setup aus

Gitlab CE gibt 502 Bad Gateway hinter Dockerized Nginx Reverse Proxy Setup aus

Ich habe den beliebten Dockerized Nginx Reverse Proxy verwendetaufstellenfür meinen VPS, um mehrere Websites oder Apps in Containerform zu hosten. Derzeit funktioniert es einwandfrei und ich kann meinen statischen Inhalt bereitstellen.

Obwohl ich im Moment dabei bin, Gitlab erneut in einem Container einzurichten, schlägt dies immer fehl und führt zu einem 502 Bad GatewayFehler, wenn ich die URL besuche, nachdem ich den Container gestartet habe.

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

Wenn ich die Protokolle für den Container überprüfe, ist hier das vollständige Protokoll, aber im Wesentlichen beschwert es sich darüber, dass es external_urlnicht richtig eingestellt ist und Chef Intra Clientnicht gestartet werden kann.

================================================================================
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...

Ich habe es überprüft gitlab.rb, indem ich interaktiv in den Container gegangen bin, und es external_urlist richtig eingestellt, aber aus irgendeinem Grund, den ich nicht herausfinden kann, funktioniert es einfach nicht.

verwandte Informationen