简体   繁体   English

docker-compose + nginx-proxy + letsencrypt-nginx-proxy-companion + gitlab-ce = SSH连接在git clone上失败

[英]docker-compose + nginx-proxy + letsencrypt-nginx-proxy-companion + gitlab-ce = SSH Connection fail on git clone

I have an VPS (OVH) with Debian 9 and I'm trying to create something like this: 我有一个使用Debian 9的VPS(OVH),我正在尝试创建这样的东西:

搬运工人

When I'm trying to connect via https everything works great. 当我尝试通过https连接时,一切都很好。 But when I'm trying to clone repository via SSH it fail. 但是,当我尝试通过SSH克隆存储库时,它失败了。

This is my docker-composer.yml file: 这是我的docker-composer.yml文件:

version: '2'

services:

  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "/etc/nginx/vhost.d"
      - "/usr/share/nginx/html"
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
      - "/etc/nginx/certs"

  letsencrypt-nginx-proxy-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    volumes_from:
      - "nginx-proxy"

  gitlab:
      image: 'gitlab/gitlab-ce'
      restart: always
      container_name: gitlab
      hostname: 'gitlab.example.com'
      environment:
        VIRTUAL_HOST: gitlab.example.com
        LETSENCRYPT_HOST: gitlab.example.com
        LETSENCRYPT_EMAIL: admin@example.com
        GITLAB_OMNIBUS_CONFIG: |
          external_url 'http://gitlab.example.com'

      volumes:
        - '/srv/gitlab/config:/etc/gitlab'
        - '/srv/gitlab/logs:/var/log/gitlab'
        - '/srv/gitlab/data:/var/opt/gitlab'

  gitlab-runner:
      image: gitlab/gitlab-runner
      container_name: gitlab-runner
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - ./conf:/etc/gitlab-runner
      restart: always

I think, that I won't be able to connect via port 22 so I might need to add to Omnibus config this line: 我想,我将无法通过端口22连接,所以我可能需要添加到Omnibus配置这一行:

gitlab_rails['gitlab_shell_ssh_port'] = 2222

Unfortunately, when I'm trying to add port "2222:2222" to nginx-proxy and/or to gitlab container there is information, that port 2222 is already used. 不幸的是,当我尝试将端口“2222:2222”添加到nginx-proxy和/或gitlab容器时,有信息,端口2222已经被使用。

What is best way to configure this stack so when I connect to VPS (example.com) I'll connect to Debian, but when gitlab (gitlab.example.com) I'll be able to clone repository? 什么是配置此堆栈的最佳方式,所以当我连接到VPS(example.com)时,我将连接到Debian,但是当gitlab(gitlab.example.com)我将能够克隆存储库?

It's not nginx that should handle the ssh connections, but an SSH daemon. 它不是应该处理ssh连接的nginx,而是一个SSH守护进程。 So the Gitlab docker should also run an SSH daemon, which could listen on port 2222 if available. 所以Gitlab docker也应该运行一个SSH守护进程,如果可用,它可以监听端口2222。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 jwilder/nginx-proxy 和 jrcs/letsencrypt-nginx-proxy-companion 后面的 docker 中的 gitea - gitea in docker behind jwilder/nginx-proxy and jrcs/letsencrypt-nginx-proxy-companion Docker + jwilder/nginx-proxy + jwilder/docker-gen + jrcs/letsencrypt-nginx-proxy-companion + php:7-fpm + wordpress:fpm - Docker + jwilder/nginx-proxy + jwilder/docker-gen + jrcs/letsencrypt-nginx-proxy-companion + php:7-fpm + wordpress:fpm 子域名,Nginx-proxy和Docker-compose - Subdomains, Nginx-proxy and Docker-compose Unraid Nginx 反向代理 GitLab-CE Docker - Unraid Nginx Reverse Proxy GitLab-CE Docker “jrcs/letsencrypt-nginx-proxy-companion” docker 图像:已经为确切的域集颁发了太多证书 - "jrcs/letsencrypt-nginx-proxy-companion" docker image: too many certificates already issued for exact set of domains 在我的 docker-compose + nginx-proxy 中设置 2 个域 - setup 2 domains in my docker-compose + nginx-proxy 无法使用nginx-proxy和dnsmasq在具有docker-compose的容器之间访问虚拟主机 - Cannot access virtual hosts between containers with docker-compose using nginx-proxy and dnsmasq docker-compose + letsencrypt + nginx-proxy。 nginx.conf在哪里? - docker-compose + letsencrypt + nginx-proxy. Where is nginx.conf? 503服务暂时不可用gitlab docker和nginx-proxy docker - 503 Service Temporarily Unavailable with gitlab docker and nginx-proxy docker docker-letsencrypt-nginx-proxy-companion 无法启用 ssl - Can't enable ssl by docker-letsencrypt-nginx-proxy-companion
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM